diff options
author | Sami Kerola | 2014-12-06 11:47:53 +0100 |
---|---|---|
committer | Sami Kerola | 2014-12-08 21:07:00 +0100 |
commit | d01f47f6f5842ac656b0d3fe01a6414af399f1ca (patch) | |
tree | 228a7c21fefcf278566180184b0c1414a35e40f7 /misc-utils | |
parent | tests: add more getopt tests (diff) | |
download | kernel-qcow2-util-linux-d01f47f6f5842ac656b0d3fe01a6414af399f1ca.tar.gz kernel-qcow2-util-linux-d01f47f6f5842ac656b0d3fe01a6414af399f1ca.tar.xz kernel-qcow2-util-linux-d01f47f6f5842ac656b0d3fe01a6414af399f1ca.zip |
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 <frodo@frodo.looijaard.name>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'misc-utils')
-rw-r--r-- | misc-utils/getopt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/misc-utils/getopt.c b/misc-utils/getopt.c index c087e4a58..d7918b165 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 |