summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-04-05 21:32:26 +0000
committerJim Meyering <jim@meyering.net>1998-04-05 21:32:26 +0000
commit3911fadcf972b195523cdfc712e92f88363420b9 (patch)
tree81d7ec49e22a4022284f53b1850dca093f4bc6bb
parent382ca69cecf76900307db1e4e8ce126884f03610 (diff)
downloadcoreutils-3911fadcf972b195523cdfc712e92f88363420b9.tar.xz
add braces to disambiguate ambiguous else
-rw-r--r--lib/getopt.c22
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);