From: Sami Kerola Date: Sat, 6 Dec 2014 10:47:53 +0000 (+0000) Subject: getopt: make nonoptions optstring comment correct X-Git-Tag: v2.26-rc1~140^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d01f47f6f5842ac656b0d3fe01a6414af399f1ca;p=thirdparty%2Futil-linux.git getopt: make nonoptions optstring comment correct From manual page: 'If the first character of optstring is '-', then each nonoption argv-element is handled as if it were the argument of an option with character code 1.' Reference: http://man7.org/linux/man-pages/man3/getopt.3.html CC: Frodo Looijaard Signed-off-by: Sami Kerola --- diff --git a/misc-utils/getopt.c b/misc-utils/getopt.c index c087e4a58d..d7918b1655 100644 --- a/misc-utils/getopt.c +++ b/misc-utils/getopt.c @@ -67,8 +67,8 @@ #include "nls.h" #include "xalloc.h" -/* NON_OPT is the code that is returned when a non-option is found in '+' - * mode */ +/* NON_OPT is the code that is returned getopt(3) when a non-option is + * found in 'char optstring[]="-abc...";', e.g., it begins by '-' */ #define NON_OPT 1 /* LONG_OPT is the code that is returned when a long option is found. */ #define LONG_OPT 0