Commit Graph

3 Commits

Author SHA1 Message Date
Đoàn Trần Công Danh 27fd7278a1 getopt: explicitly ask for POSIX mode on POSIXLY_CORRECT
GNU libc's getopt_long(3) have the tradition of not shuffling arguments
to find options when either POSIXLY_CORRECT is defined in environment
variables or '+' prepended in short options. Hence, the current code
base is fine as is fine as is for util-linux built with GNU libc.

However, musl libc only honour POSIX convention when short options
prepended with '+'. musl libc doesn't care about POSIXLY_CORRECT.
Thus, the behaviour of util-linux's getopt(1) that linked with musl-libc
doesn't match with its own documentation.

Let's make sure a '+' is always prepended to short options if
POSIXLY_CORRECT is defined.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2021-01-06 20:57:57 +07:00
Karel Zak 7ffd3b0ef6 build-sys: do not use extra subdir for getopt examples
This is unnecessary, we have ${docsdir}/util-linux which is good
enough for these two getopt examples. I guess the "getopt"
subdirectory is legacy from time getopt has been merged into
util-linux.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-11-24 12:46:03 +01:00
Sami Kerola 44702f12f7
getopt: use examples installation directory in man page
Addresses: https://bugs.debian.org/913049
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-02-15 15:24:01 +00:00