diff options
Diffstat (limited to 'applets')
-rw-r--r-- | applets/busybox.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/applets/busybox.c b/applets/busybox.c index 13f8db909..a80a5678f 100644 --- a/applets/busybox.c +++ b/applets/busybox.c | |||
@@ -300,15 +300,17 @@ static const struct Applet applets[] = { | |||
300 | 300 | ||
301 | int main(int argc, char **argv) | 301 | int main(int argc, char **argv) |
302 | { | 302 | { |
303 | char *s = argv[0]; | 303 | char *s = argv[0]; |
304 | char *name = argv[0]; | 304 | char *name = argv[0]; |
305 | const struct Applet *a = applets; | 305 | const struct Applet *a = applets; |
306 | 306 | ||
307 | while (*s != '\0') { | 307 | while (*s != '\0') { |
308 | if (*s++ == '/') | 308 | if (*s++ == '/') |
309 | name = s; | 309 | name = s; |
310 | } | 310 | } |
311 | 311 | ||
312 | *argv = name; | ||
313 | |||
312 | while (a->name != 0) { | 314 | while (a->name != 0) { |
313 | if (strcmp(name, a->name) == 0) { | 315 | if (strcmp(name, a->name) == 0) { |
314 | int status; | 316 | int status; |
@@ -341,7 +343,7 @@ int busybox_main(int argc, char **argv) | |||
341 | fprintf(stderr, "Usage: busybox [function] [arguments]...\n"); | 343 | fprintf(stderr, "Usage: busybox [function] [arguments]...\n"); |
342 | fprintf(stderr, " or: [function] [arguments]...\n\n"); | 344 | fprintf(stderr, " or: [function] [arguments]...\n\n"); |
343 | fprintf(stderr, | 345 | fprintf(stderr, |
344 | "\tMost people will create a symlink to busybox for each\n" | 346 | "\tMost people will create a link to busybox for each\n" |
345 | "\tfunction name, and busybox will act like whatever you invoke it as.\n"); | 347 | "\tfunction name, and busybox will act like whatever you invoke it as.\n"); |
346 | fprintf(stderr, "\nCurrently defined functions:\n"); | 348 | fprintf(stderr, "\nCurrently defined functions:\n"); |
347 | 349 | ||
@@ -362,3 +364,11 @@ int busybox_main(int argc, char **argv) | |||
362 | return (main(argc, argv)); | 364 | return (main(argc, argv)); |
363 | } | 365 | } |
364 | } | 366 | } |
367 | |||
368 | /* | ||
369 | Local Variables: | ||
370 | c-file-style: "linux" | ||
371 | c-basic-offset: 4 | ||
372 | tab-width: 4 | ||
373 | End: | ||
374 | */ | ||