[git commit master 1/1] libbb: remove dead code in getopt32. -7 bytes

Denys Vlasenko vda.linux at googlemail.com
Tue Mar 1 18:25:49 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=ea6116ee59af0945f4a6ac9ede984930a0ede429
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Alexey Fomenko <ext-alexey.fomenko at nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/getopt32.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/libbb/getopt32.c b/libbb/getopt32.c
index f3f1cfc..18f33c7 100644
--- a/libbb/getopt32.c
+++ b/libbb/getopt32.c
@@ -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 */
-- 
1.7.3.4



More information about the busybox-cvs mailing list