summaryrefslogtreecommitdiff
path: root/src/getopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/getopt.c')
-rw-r--r--src/getopt.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/getopt.c b/src/getopt.c
index bc1f1caf..7a792de8 100644
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -436,6 +436,10 @@ _getopt_initialize (int argc, char *const *argv, const char *optstring)
nonoption_flags_len = 0;
#endif
+ /* Make the compiler happy. */
+ (void)argc;
+ (void)argv;
+
return optstring;
}
@@ -677,17 +681,18 @@ _getopt_internal (int argc, char *const *argv, const char *optstring,
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);
optopt = pfound->val;