diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-21 05:07:43 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-03-21 05:07:43 +0100 |
commit | 32176ccec4eb1a3bc26b0217fa8d23f6ff44fab8 (patch) | |
tree | 135fb88a7c6c2fe024c7c8d03f6878be8fb84263 /init/init.c | |
parent | e2e55b0eb5e3518702f31b122acd9894630b0368 (diff) | |
download | busybox-w32-32176ccec4eb1a3bc26b0217fa8d23f6ff44fab8.tar.gz busybox-w32-32176ccec4eb1a3bc26b0217fa8d23f6ff44fab8.tar.bz2 busybox-w32-32176ccec4eb1a3bc26b0217fa8d23f6ff44fab8.zip |
init: fix a case where execv's 1st arg was wrong
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'init/init.c')
-rw-r--r-- | init/init.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c index 586e34a18..ff9dc06a4 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -414,6 +414,7 @@ static void init_exec(const char *command) | |||
414 | char *word, *next; | 414 | char *word, *next; |
415 | int i = 0; | 415 | int i = 0; |
416 | next = strcpy(buf, command - dash); /* command including "-" */ | 416 | next = strcpy(buf, command - dash); /* command including "-" */ |
417 | command = next + dash; | ||
417 | while ((word = strsep(&next, " \t")) != NULL) { | 418 | while ((word = strsep(&next, " \t")) != NULL) { |
418 | if (*word != '\0') { /* not two spaces/tabs together? */ | 419 | if (*word != '\0') { /* not two spaces/tabs together? */ |
419 | cmd[i] = word; | 420 | cmd[i] = word; |