diff options
author | Jim Meyering <jim@meyering.net> | 1998-04-05 21:32:26 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-04-05 21:32:26 +0000 |
commit | 3911fadcf972b195523cdfc712e92f88363420b9 (patch) | |
tree | 81d7ec49e22a4022284f53b1850dca093f4bc6bb /lib/getopt.c | |
parent | 382ca69cecf76900307db1e4e8ce126884f03610 (diff) | |
download | coreutils-3911fadcf972b195523cdfc712e92f88363420b9.tar.xz |
add braces to disambiguate ambiguous else
Diffstat (limited to 'lib/getopt.c')
-rw-r--r-- | lib/getopt.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/getopt.c b/lib/getopt.c index 19f3f0565..23393ff0c 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -701,16 +701,18 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) else { if (opterr) - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + _("%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + _("%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[optind - 1][0], pfound->name); + } nextchar += strlen (nextchar); |