← Commit list

913734185

Denis Vlasenko
Denis Vlasenko
2008-04-21
FAILED Duration: 26s

Subject

getopt32: fix recently broken opt_complementary "--"

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/getopt32.c+3 -2
@@ -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)