diff options
author | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-10-03 13:21:10 +0000 |
---|---|---|
committer | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-10-03 13:21:10 +0000 |
commit | 8d328160c90490f6826a62070a367966c7ea5fd0 (patch) | |
tree | a0ee11950d11c9acee9c9fe7d82c4d3a5dc000fb /applets | |
parent | 8180ed7d9345ba4d7be37775d0bd1ad49ed47766 (diff) | |
download | busybox-w32-8d328160c90490f6826a62070a367966c7ea5fd0.tar.gz busybox-w32-8d328160c90490f6826a62070a367966c7ea5fd0.tar.bz2 busybox-w32-8d328160c90490f6826a62070a367966c7ea5fd0.zip |
Reverse my previous changes and make a note about why its dont this way
git-svn-id: svn://busybox.net/trunk/busybox@7598 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'applets')
-rw-r--r-- | applets/busybox.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/applets/busybox.c b/applets/busybox.c index 13b9f6fcb..9d41b52f7 100644 --- a/applets/busybox.c +++ b/applets/busybox.c | |||
@@ -162,7 +162,18 @@ int busybox_main(int argc, char **argv) | |||
162 | been_there_done_that = 1; | 162 | been_there_done_that = 1; |
163 | 163 | ||
164 | /* Move the command line down a notch */ | 164 | /* Move the command line down a notch */ |
165 | return (main(argc, argv+1)); | 165 | /* Preserve pointers so setproctitle() works consistently */ |
166 | len = argv[argc] + strlen(argv[argc]) - argv[1]; | ||
167 | memmove(argv[0], argv[1], len); | ||
168 | memset(argv[0] + len, 0, argv[1] - argv[0]); | ||
169 | |||
170 | /* Fix up the argv pointers */ | ||
171 | len = argv[1] - argv[0]; | ||
172 | memmove(argv, argv + 1, sizeof(char *) * (argc + 1)); | ||
173 | for (i = 0; i < argc; i++) | ||
174 | argv[i] -= len; | ||
175 | |||
176 | return (main(argc, argv)); | ||
166 | } | 177 | } |
167 | 178 | ||
168 | /* | 179 | /* |