From 5aab966edd2479e8a933bd02aba2fc33641b9832 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 18 Jan 2007 22:00:46 -0500 Subject: Save 4 bytes of stack space. --- main.c | 17 ++++++++++------- 1 file 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(); -- cgit v1.2.3