diff options
author | Rob Landley <rob@landley.net> | 2007-01-18 22:00:46 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2007-01-18 22:00:46 -0500 |
commit | 5aab966edd2479e8a933bd02aba2fc33641b9832 (patch) | |
tree | a0f714c3773627583ec3121569dfad239991a3ff | |
parent | 6000f13e8ac8c17c1f01fcafc8066bb7b419f224 (diff) | |
download | toybox-5aab966edd2479e8a933bd02aba2fc33641b9832.tar.gz |
Save 4 bytes of stack space.
-rw-r--r-- | main.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -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(); |