Commit 628a2c19 authored by Niels Möller's avatar Niels Möller

Fix c99-ism in getopt.c. Reported by Henrik Grubbström.

parent dd83950b
2016-03-14 Niels Möller <nisse@lysator.liu.se>
* getopt.c (_getopt_internal_r): Fix c99-ism, move declarations to
top of block. Reported by Henrik Grubbström.
2016-02-16 Niels Möller <nisse@lysator.liu.se>
* tools/input.c (sexp_get_string_length): Process advanced string
......
......@@ -870,9 +870,6 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
/* Convenience. Treat POSIX -W foo same as long option --foo */
if (temp[0] == 'W' && temp[1] == ';')
{
if (longopts == NULL)
goto no_longs;
char *nameend;
const struct option *p;
const struct option *pfound = NULL;
......@@ -881,6 +878,9 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
int indfound = 0;
int option_index;
if (longopts == NULL)
goto no_longs;
/* This is an option that requires an argument. */
if (*d->__nextchar != '\0')
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment