diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-05 01:46:59 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-05 01:46:59 +0000 |
commit | 16a0c74f638d2d730525856d391078f2ea662aeb (patch) | |
tree | 7a2bec11e284438bb0e73d939a1909dc5a5d2a90 | |
parent | 0bb4a23506c07c2b696a91661d38b86860e2e7be (diff) | |
download | busybox-w32-16a0c74f638d2d730525856d391078f2ea662aeb.tar.gz busybox-w32-16a0c74f638d2d730525856d391078f2ea662aeb.tar.bz2 busybox-w32-16a0c74f638d2d730525856d391078f2ea662aeb.zip |
hush: fix hush-misc/break5.tests NOMMU failure
function old new delta
hush_main 1118 1144 +26
re_execute_shell 188 204 +16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 42/0) Total: 42 bytes
-rw-r--r-- | shell/hush.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/shell/hush.c b/shell/hush.c index 13e962383..3388ad7f9 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -2345,8 +2345,8 @@ static void re_execute_shell(const char *s) | |||
2345 | char **argv, **pp; | 2345 | char **argv, **pp; |
2346 | unsigned cnt; | 2346 | unsigned cnt; |
2347 | 2347 | ||
2348 | /* hush -$<pid> -?<exitcode> ... -c <cmd> NULL */ | 2348 | /* hush -$<pid> -?<exitcode> -D<depth> ... -c <cmd> NULL */ |
2349 | cnt = 6; | 2349 | cnt = 7; |
2350 | for (cur = G.top_var; cur; cur = cur->next) { | 2350 | for (cur = G.top_var; cur; cur = cur->next) { |
2351 | if (!cur->flg_export || cur->flg_read_only) | 2351 | if (!cur->flg_export || cur->flg_read_only) |
2352 | cnt += 2; | 2352 | cnt += 2; |
@@ -2356,6 +2356,7 @@ static void re_execute_shell(const char *s) | |||
2356 | *pp++ = (char *) applet_name; | 2356 | *pp++ = (char *) applet_name; |
2357 | *pp++ = xasprintf("-$%u", G.root_pid); | 2357 | *pp++ = xasprintf("-$%u", G.root_pid); |
2358 | *pp++ = xasprintf("-?%u", G.last_return_code); | 2358 | *pp++ = xasprintf("-?%u", G.last_return_code); |
2359 | *pp++ = xasprintf("-D%u", G.depth_of_loop); | ||
2359 | for (cur = G.top_var; cur; cur = cur->next) { | 2360 | for (cur = G.top_var; cur; cur = cur->next) { |
2360 | if (cur->varstr == hush_version_str) | 2361 | if (cur->varstr == hush_version_str) |
2361 | continue; | 2362 | continue; |
@@ -5009,7 +5010,7 @@ int hush_main(int argc, char **argv) | |||
5009 | while (1) { | 5010 | while (1) { |
5010 | opt = getopt(argc, argv, "c:xins" | 5011 | opt = getopt(argc, argv, "c:xins" |
5011 | #if !BB_MMU | 5012 | #if !BB_MMU |
5012 | "$:?:R:V:" | 5013 | "$:?:D:R:V:" |
5013 | #endif | 5014 | #endif |
5014 | ); | 5015 | ); |
5015 | if (opt <= 0) | 5016 | if (opt <= 0) |
@@ -5041,6 +5042,9 @@ int hush_main(int argc, char **argv) | |||
5041 | case '?': | 5042 | case '?': |
5042 | G.last_return_code = xatoi_u(optarg); | 5043 | G.last_return_code = xatoi_u(optarg); |
5043 | break; | 5044 | break; |
5045 | case 'D': | ||
5046 | G.depth_of_loop = xatoi_u(optarg); | ||
5047 | break; | ||
5044 | case 'R': | 5048 | case 'R': |
5045 | case 'V': | 5049 | case 'V': |
5046 | set_local_var(xstrdup(optarg), 0, opt == 'R'); | 5050 | set_local_var(xstrdup(optarg), 0, opt == 'R'); |