From: Jim Meyering Date: Sun, 5 Apr 1998 21:32:26 +0000 (+0000) Subject: add braces to disambiguate ambiguous else X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=622278029bccdbfbe101ae477be47e175cfc802d;p=pspp add braces to disambiguate ambiguous else --- diff --git a/lib/getopt.c b/lib/getopt.c index 19f3f05659..23393ff0ca 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);