aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-04-21 22:04:21 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-04-21 22:04:21 +0000
commit9137341851f3ab89f5c6a54a6baff68f0f4a5e17 (patch)
tree4fe6ff0882222938c452b09f127d00a43c5b0566
parent5a07a1d255da10214ddd3cb8dda75bfbfdf46e4c (diff)
downloadbusybox-w32-9137341851f3ab89f5c6a54a6baff68f0f4a5e17.tar.gz
busybox-w32-9137341851f3ab89f5c6a54a6baff68f0f4a5e17.tar.bz2
busybox-w32-9137341851f3ab89f5c6a54a6baff68f0f4a5e17.zip
getopt32: fix recently broken opt_complementary "--"
-rw-r--r--libbb/getopt32.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libbb/getopt32.c b/libbb/getopt32.c
index cd890323e..913a009b0 100644
--- a/libbb/getopt32.c
+++ b/libbb/getopt32.c
@@ -497,8 +497,9 @@ getopt32(char **argv, const char *applet_opts, ...)
497 if (argv[1] && argv[1][0] != '-' && argv[1][1] != '\0') { 497 if (argv[1] && argv[1][0] != '-' && argv[1][1] != '\0') {
498#if DONT_USE_PRINTF 498#if DONT_USE_PRINTF
499 char *pp = alloca(strlen(argv[1]) + 2); 499 char *pp = alloca(strlen(argv[1]) + 2);
500 *pp++ = '-'; 500 *pp = '-';
501 argv[1] = strcpy(pp, argv[1]); 501 strcpy(pp + 1, argv[1]);
502 argv[1] = pp;
502#else 503#else
503 argv[1] = xasprintf("-%s", argv[1]); 504 argv[1] = xasprintf("-%s", argv[1]);
504 if (ENABLE_FEATURE_CLEAN_UP) 505 if (ENABLE_FEATURE_CLEAN_UP)