aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/hush.c10
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');