diff options
Diffstat (limited to 'posix')
-rw-r--r-- | posix/getconf.c | 12 | ||||
-rw-r--r-- | posix/getopt.c | 22 | ||||
-rw-r--r-- | posix/wordexp.c | 24 |
3 files changed, 33 insertions, 25 deletions
diff --git a/posix/getconf.c b/posix/getconf.c index 7219c8d5a5..f0b8c910ab 100644 --- a/posix/getconf.c +++ b/posix/getconf.c @@ -662,11 +662,13 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ usage (); value = sysconf (c->call_name); if (value == -1l) - if (c->call_name == _SC_UINT_MAX - || c->call_name == _SC_ULONG_MAX) - printf ("%lu\n", value); - else - puts (_("undefined")); + { + if (c->call_name == _SC_UINT_MAX + || c->call_name == _SC_ULONG_MAX) + printf ("%lu\n", value); + else + puts (_("undefined")); + } else printf ("%ld\n", value); exit (0); diff --git a/posix/getopt.c b/posix/getopt.c index 4d837c041a..81cef23f9b 100644 --- a/posix/getopt.c +++ b/posix/getopt.c @@ -695,16 +695,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); diff --git a/posix/wordexp.c b/posix/wordexp.c index dff5d30dad..0eb0721230 100644 --- a/posix/wordexp.c +++ b/posix/wordexp.c @@ -426,6 +426,7 @@ parse_glob (char **word, size_t *word_length, size_t *max_length, /* Sort out quoting */ if (words[*offset] == '\'') + { if (quoted == 0) { quoted = 1; @@ -436,17 +437,20 @@ parse_glob (char **word, size_t *word_length, size_t *max_length, quoted = 0; continue; } + } else if (words[*offset] == '"') - if (quoted == 0) - { - quoted = 2; - continue; - } - else if (quoted == 2) - { - quoted = 0; - continue; - } + { + if (quoted == 0) + { + quoted = 2; + continue; + } + else if (quoted == 2) + { + quoted = 0; + continue; + } + } /* Sort out other special characters */ if (quoted != 1 && words[*offset] == '$') |