aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2007-01-18 22:00:46 -0500
committerRob Landley <rob@landley.net>2007-01-18 22:00:46 -0500
commit5aab966edd2479e8a933bd02aba2fc33641b9832 (patch)
treea0f714c3773627583ec3121569dfad239991a3ff
parent6000f13e8ac8c17c1f01fcafc8066bb7b419f224 (diff)
downloadtoybox-5aab966edd2479e8a933bd02aba2fc33641b9832.tar.gz
Save 4 bytes of stack space.
-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();