projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a07a1d
)
getopt32: fix recently broken opt_complementary "--"
author
Denis Vlasenko
<vda.linux@googlemail.com>
Mon, 21 Apr 2008 22:04:21 +0000
(22:04 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Mon, 21 Apr 2008 22:04:21 +0000
(22:04 -0000)
libbb/getopt32.c
patch
|
blob
|
history
diff --git
a/libbb/getopt32.c
b/libbb/getopt32.c
index cd890323e41c48edcb12b3f550d88e1406954216..913a009b0655f655e1f47b3e70ea0253435e51d6 100644
(file)
--- a/
libbb/getopt32.c
+++ b/
libbb/getopt32.c
@@
-497,8
+497,9
@@
getopt32(char **argv, const char *applet_opts, ...)
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)