libbb: remove dead code in getopt32. -7 bytes
authorAlexey Fomenko <ext-alexey.fomenko@nokia.com>
Tue, 1 Mar 2011 18:25:49 +0000 (19:25 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 1 Mar 2011 18:25:49 +0000 (19:25 +0100)
Signed-off-by: Alexey Fomenko <ext-alexey.fomenko@nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/getopt32.c

index f3f1cfcbaac8e9cde4b8b98e57e48759a9c63408..18f33c7041d6fd4129ea18b88e318f99143cc070 100644 (file)
@@ -542,8 +542,6 @@ getopt32(char **argv, const char *applet_opts, ...)
 #endif
        /* optarg = NULL; opterr = 0; optopt = 0; - do we need this?? */
 
-       pargv = NULL;
-
        /* Note: just "getopt() <= 0" will not work well for
         * "fake" short options, like this one:
         * wget $'-\203' "Test: test" http://kernel.org/
@@ -574,19 +572,16 @@ getopt32(char **argv, const char *applet_opts, ...)
                flags ^= trigger;
                if (on_off->counter)
                        (*(on_off->counter))++;
-               if (on_off->param_type == PARAM_LIST) {
-                       if (optarg)
+               if (optarg) {
+                       if (on_off->param_type == PARAM_LIST) {
                                llist_add_to_end((llist_t **)(on_off->optarg), optarg);
-               } else if (on_off->param_type == PARAM_INT) {
-                       if (optarg)
+                       } else if (on_off->param_type == PARAM_INT) {
 //TODO: xatoi_positive indirectly pulls in printf machinery
                                *(unsigned*)(on_off->optarg) = xatoi_positive(optarg);
-               } else if (on_off->optarg) {
-                       if (optarg)
+                       } else if (on_off->optarg) {
                                *(char **)(on_off->optarg) = optarg;
+                       }
                }
-               if (pargv != NULL)
-                       break;
        }
 
        /* check depending requires for given options */