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
This commit is contained in:
parent
0bb4a23506
commit
16a0c74f63
10
shell/hush.c
10
shell/hush.c
@ -2345,8 +2345,8 @@ static void re_execute_shell(const char *s)
|
|||||||
char **argv, **pp;
|
char **argv, **pp;
|
||||||
unsigned cnt;
|
unsigned cnt;
|
||||||
|
|
||||||
/* hush -$<pid> -?<exitcode> ... -c <cmd> NULL */
|
/* hush -$<pid> -?<exitcode> -D<depth> ... -c <cmd> NULL */
|
||||||
cnt = 6;
|
cnt = 7;
|
||||||
for (cur = G.top_var; cur; cur = cur->next) {
|
for (cur = G.top_var; cur; cur = cur->next) {
|
||||||
if (!cur->flg_export || cur->flg_read_only)
|
if (!cur->flg_export || cur->flg_read_only)
|
||||||
cnt += 2;
|
cnt += 2;
|
||||||
@ -2356,6 +2356,7 @@ static void re_execute_shell(const char *s)
|
|||||||
*pp++ = (char *) applet_name;
|
*pp++ = (char *) applet_name;
|
||||||
*pp++ = xasprintf("-$%u", G.root_pid);
|
*pp++ = xasprintf("-$%u", G.root_pid);
|
||||||
*pp++ = xasprintf("-?%u", G.last_return_code);
|
*pp++ = xasprintf("-?%u", G.last_return_code);
|
||||||
|
*pp++ = xasprintf("-D%u", G.depth_of_loop);
|
||||||
for (cur = G.top_var; cur; cur = cur->next) {
|
for (cur = G.top_var; cur; cur = cur->next) {
|
||||||
if (cur->varstr == hush_version_str)
|
if (cur->varstr == hush_version_str)
|
||||||
continue;
|
continue;
|
||||||
@ -5009,7 +5010,7 @@ int hush_main(int argc, char **argv)
|
|||||||
while (1) {
|
while (1) {
|
||||||
opt = getopt(argc, argv, "c:xins"
|
opt = getopt(argc, argv, "c:xins"
|
||||||
#if !BB_MMU
|
#if !BB_MMU
|
||||||
"$:?:R:V:"
|
"$:?:D:R:V:"
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
if (opt <= 0)
|
if (opt <= 0)
|
||||||
@ -5041,6 +5042,9 @@ int hush_main(int argc, char **argv)
|
|||||||
case '?':
|
case '?':
|
||||||
G.last_return_code = xatoi_u(optarg);
|
G.last_return_code = xatoi_u(optarg);
|
||||||
break;
|
break;
|
||||||
|
case 'D':
|
||||||
|
G.depth_of_loop = xatoi_u(optarg);
|
||||||
|
break;
|
||||||
case 'R':
|
case 'R':
|
||||||
case 'V':
|
case 'V':
|
||||||
set_local_var(xstrdup(optarg), 0, opt == 'R');
|
set_local_var(xstrdup(optarg), 0, opt == 'R');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user