Mercurial > hg > octave-lyh > gnulib-hg
changeset 1305:62df1b99c9ab
add braces to disambiguate ambiguous else
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sun, 05 Apr 1998 21:32:26 +0000 |
parents | 25cabb50fd0e |
children | 471d1c24b50f |
files | lib/getopt.c |
diffstat | 1 files changed, 12 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/getopt.c +++ b/lib/getopt.c @@ -701,16 +701,18 @@ 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);