Fixup the previous commit for GCC. [skip ci]
authorDenis Ovsienko <denis@ovsienko.info>
Sat, 24 Jul 2021 10:43:25 +0000 (11:43 +0100)
committerDenis Ovsienko <denis@ovsienko.info>
Sat, 24 Jul 2021 10:43:25 +0000 (11:43 +0100)
Apparently, it does not like pragmas in the middle of a statement:

./missing/getopt_long.c: In function 'getopt_internal':
./missing/getopt_long.c:572:3: error: 'else' without a previous 'if'

missing/getopt_long.c

index 5018400ed0e41d5c09b42323f8958b08ba56d0de..927028ffc34d75a61aa02f326d8632dda50a71e8 100644 (file)
@@ -565,11 +565,11 @@ start:
                        ++optind;
        } else {                                /* takes (optional) argument */
                optarg = NULL;
+               if (*place) {                   /* no white space */
 DIAG_OFF_CAST_QUAL
-               if (*place)                     /* no white space */
                        optarg = (char *)place;
 DIAG_ON_CAST_QUAL
-               else if (oli[1] != ':') {       /* arg not optional */
+               } else if (oli[1] != ':') {     /* arg not optional */
                        if (++optind >= nargc) {        /* no arg */
                                place = EMSG;
                                if (PRINT_ERROR)