mirror of
https://github.com/sheumann/hush.git
synced 2024-12-28 22:30:05 +00:00
libbb: remove dead code in getopt32. -7 bytes
Signed-off-by: Alexey Fomenko <ext-alexey.fomenko@nokia.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
5e29e26388
commit
ea6116ee59
@ -542,8 +542,6 @@ getopt32(char **argv, const char *applet_opts, ...)
|
|||||||
#endif
|
#endif
|
||||||
/* optarg = NULL; opterr = 0; optopt = 0; - do we need this?? */
|
/* optarg = NULL; opterr = 0; optopt = 0; - do we need this?? */
|
||||||
|
|
||||||
pargv = NULL;
|
|
||||||
|
|
||||||
/* Note: just "getopt() <= 0" will not work well for
|
/* Note: just "getopt() <= 0" will not work well for
|
||||||
* "fake" short options, like this one:
|
* "fake" short options, like this one:
|
||||||
* wget $'-\203' "Test: test" http://kernel.org/
|
* wget $'-\203' "Test: test" http://kernel.org/
|
||||||
@ -574,19 +572,16 @@ getopt32(char **argv, const char *applet_opts, ...)
|
|||||||
flags ^= trigger;
|
flags ^= trigger;
|
||||||
if (on_off->counter)
|
if (on_off->counter)
|
||||||
(*(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);
|
llist_add_to_end((llist_t **)(on_off->optarg), optarg);
|
||||||
} else if (on_off->param_type == PARAM_INT) {
|
} else if (on_off->param_type == PARAM_INT) {
|
||||||
if (optarg)
|
|
||||||
//TODO: xatoi_positive indirectly pulls in printf machinery
|
//TODO: xatoi_positive indirectly pulls in printf machinery
|
||||||
*(unsigned*)(on_off->optarg) = xatoi_positive(optarg);
|
*(unsigned*)(on_off->optarg) = xatoi_positive(optarg);
|
||||||
} else if (on_off->optarg) {
|
} else if (on_off->optarg) {
|
||||||
if (optarg)
|
|
||||||
*(char **)(on_off->optarg) = optarg;
|
*(char **)(on_off->optarg) = optarg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (pargv != NULL)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check depending requires for given options */
|
/* check depending requires for given options */
|
||||||
|
Loading…
Reference in New Issue
Block a user