]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
getopt: make nonoptions optstring comment correct
authorSami Kerola <kerolasa@iki.fi>
Sat, 6 Dec 2014 10:47:53 +0000 (10:47 +0000)
committerSami Kerola <kerolasa@iki.fi>
Mon, 8 Dec 2014 20:07:00 +0000 (20:07 +0000)
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 <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
misc-utils/getopt.c

index c087e4a58df952b6c6de919fff7c7bd2771d7a5e..d7918b1655dbff14fbf5aab46125235843fc92ea 100644 (file)
@@ -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