diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-05 02:10:39 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-05 02:10:39 +0000 |
commit | 30db43b5c566b498f39dfc63767277a0e8f347d2 (patch) | |
tree | cfda2d561906405f16843fb181961ee353cb1b03 /shell/hush.c | |
parent | 16a0c74f638d2d730525856d391078f2ea662aeb (diff) | |
download | busybox-w32-30db43b5c566b498f39dfc63767277a0e8f347d2.tar.gz busybox-w32-30db43b5c566b498f39dfc63767277a0e8f347d2.tar.bz2 busybox-w32-30db43b5c566b498f39dfc63767277a0e8f347d2.zip |
hush: fix passing of $n on NOMMU
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/shell/hush.c b/shell/hush.c index 3388ad7f9..8ffdfb1a8 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -2342,11 +2342,13 @@ static void re_execute_shell(const char *s) NORETURN; | |||
2342 | static void re_execute_shell(const char *s) | 2342 | static void re_execute_shell(const char *s) |
2343 | { | 2343 | { |
2344 | struct variable *cur; | 2344 | struct variable *cur; |
2345 | char **argv, **pp; | 2345 | char **argv, **pp, **pp2; |
2346 | unsigned cnt; | 2346 | unsigned cnt; |
2347 | 2347 | ||
2348 | /* hush -$<pid> -?<exitcode> -D<depth> ... -c <cmd> NULL */ | 2348 | /* 1:hush 2:-$<pid> 3:-?<exitcode> 4:-D<depth> <vars...> |
2349 | cnt = 7; | 2349 | * 5:-c 6:<cmd> <argN...> 7:NULL |
2350 | */ | ||
2351 | cnt = 7 + G.global_argc; | ||
2350 | for (cur = G.top_var; cur; cur = cur->next) { | 2352 | for (cur = G.top_var; cur; cur = cur->next) { |
2351 | if (!cur->flg_export || cur->flg_read_only) | 2353 | if (!cur->flg_export || cur->flg_read_only) |
2352 | cnt += 2; | 2354 | cnt += 2; |
@@ -2370,7 +2372,9 @@ static void re_execute_shell(const char *s) | |||
2370 | } | 2372 | } |
2371 | *pp++ = (char *) "-c"; | 2373 | *pp++ = (char *) "-c"; |
2372 | *pp++ = (char *) s; | 2374 | *pp++ = (char *) s; |
2373 | //TODO: pass $N | 2375 | pp2 = G.global_argv; |
2376 | while (*pp2) | ||
2377 | *pp++ = *pp2++; | ||
2374 | *pp = NULL; | 2378 | *pp = NULL; |
2375 | //TODO: pass traps and functions | 2379 | //TODO: pass traps and functions |
2376 | 2380 | ||