aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/main.c b/main.c
index 1af6a6f9..15543afb 100644
--- a/main.c
+++ b/main.c
@@ -102,13 +102,16 @@ int toybox_main(void)
int main(int argc, char *argv[])
{
- char *name;
-
- // Figure out which applet to call.
- name = rindex(argv[0], '/');
- if (!name) name=argv[0];
- else name++;
- argv[0] = name;
+ // Artificial scope to eat less stack for things we call
+ {
+ char *name;
+
+ // Figure out which applet to call.
+ name = rindex(argv[0], '/');
+ if (!name) name=argv[0];
+ else name++;
+ argv[0] = name;
+ }
toys.argv = argv-1;
return toybox_main();