aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2003-10-03 13:21:10 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2003-10-03 13:21:10 +0000
commitf86bd9f2cdfa3e9cfb54724e98f71a7657ff6019 (patch)
treea0ee11950d11c9acee9c9fe7d82c4d3a5dc000fb
parent07cf92676ae70daab83d5aa248f24c003c07001d (diff)
downloadbusybox-w32-f86bd9f2cdfa3e9cfb54724e98f71a7657ff6019.tar.gz
busybox-w32-f86bd9f2cdfa3e9cfb54724e98f71a7657ff6019.tar.bz2
busybox-w32-f86bd9f2cdfa3e9cfb54724e98f71a7657ff6019.zip
Reverse my previous changes and make a note about why its dont this way
-rw-r--r--applets/busybox.c13
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/*