svn commit: trunk/busybox/libbb

vda at busybox.net vda at busybox.net
Mon Apr 21 22:04:21 UTC 2008


Author: vda
Date: 2008-04-21 15:04:21 -0700 (Mon, 21 Apr 2008)
New Revision: 21792

Log:
getopt32: fix recently broken opt_complementary "--"



Modified:
   trunk/busybox/libbb/getopt32.c


Changeset:
Modified: trunk/busybox/libbb/getopt32.c
===================================================================
--- trunk/busybox/libbb/getopt32.c	2008-04-21 21:56:07 UTC (rev 21791)
+++ trunk/busybox/libbb/getopt32.c	2008-04-21 22:04:21 UTC (rev 21792)
@@ -497,8 +497,9 @@
 		if (argv[1] && argv[1][0] != '-' && argv[1][1] != '\0') {
 #if DONT_USE_PRINTF
 			char *pp = alloca(strlen(argv[1]) + 2);
-			*pp++ = '-';
-			argv[1] = strcpy(pp, argv[1]);
+			*pp = '-';
+			strcpy(pp + 1, argv[1]);
+			argv[1] = pp;
 #else
 			argv[1] = xasprintf("-%s", argv[1]);
 			if (ENABLE_FEATURE_CLEAN_UP)




More information about the busybox-cvs mailing list