summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-03-21 04:07:43 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2011-03-21 04:07:43 (GMT)
commit32176ccec4eb1a3bc26b0217fa8d23f6ff44fab8 (patch)
tree135fb88a7c6c2fe024c7c8d03f6878be8fb84263
parente2e55b0eb5e3518702f31b122acd9894630b0368 (diff)
downloadbusybox-32176ccec4eb1a3bc26b0217fa8d23f6ff44fab8.tar.gz
busybox-32176ccec4eb1a3bc26b0217fa8d23f6ff44fab8.tar.bz2
init: fix a case where execv's 1st arg was wrong
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--init/init.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c
index 586e34a..ff9dc06 100644
--- a/init/init.c
+++ b/init/init.c
@@ -414,6 +414,7 @@ static void init_exec(const char *command)
char *word, *next;
int i = 0;
next = strcpy(buf, command - dash); /* command including "-" */
+ command = next + dash;
while ((word = strsep(&next, " \t")) != NULL) {
if (*word != '\0') { /* not two spaces/tabs together? */
cmd[i] = word;