diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-06 13:05:57 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-06 13:05:57 +0000 |
commit | 0969a49c081aee3c53241e2f53ebc89d14070a39 (patch) | |
tree | a7832f70acf10b5c60bd63d24189b636f41b16ae | |
parent | 34e573d2cee139f1b694737a66be394e0676d0d4 (diff) | |
download | busybox-w32-0969a49c081aee3c53241e2f53ebc89d14070a39.tar.gz busybox-w32-0969a49c081aee3c53241e2f53ebc89d14070a39.tar.bz2 busybox-w32-0969a49c081aee3c53241e2f53ebc89d14070a39.zip |
hush: beautify re_execute_shell more
-rw-r--r-- | shell/hush.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/shell/hush.c b/shell/hush.c index dfbd457a2..3eb03e50b 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -2311,6 +2311,12 @@ static void re_execute_shell(const char *s) | |||
2311 | char **argv, **pp, **pp2; | 2311 | char **argv, **pp, **pp2; |
2312 | unsigned cnt; | 2312 | unsigned cnt; |
2313 | 2313 | ||
2314 | sprintf(param_buf, "-$%x:%x:%x" USE_HUSH_LOOPS(":%x") | ||
2315 | , (unsigned) G.root_pid | ||
2316 | , (unsigned) G.last_bg_pid | ||
2317 | , (unsigned) G.last_return_code | ||
2318 | USE_HUSH_LOOPS(, G.depth_of_loop) | ||
2319 | ); | ||
2314 | /* 1:hush 2:-$<pid>:<pid>:<exitcode>:<depth> <vars...> | 2320 | /* 1:hush 2:-$<pid>:<pid>:<exitcode>:<depth> <vars...> |
2315 | * 3:-c 4:<cmd> <argN...> 5:NULL | 2321 | * 3:-c 4:<cmd> <argN...> 5:NULL |
2316 | */ | 2322 | */ |
@@ -2321,12 +2327,6 @@ static void re_execute_shell(const char *s) | |||
2321 | } | 2327 | } |
2322 | G.argv_from_re_execing = pp = xzalloc(sizeof(argv[0]) * cnt); | 2328 | G.argv_from_re_execing = pp = xzalloc(sizeof(argv[0]) * cnt); |
2323 | *pp++ = (char *) G.argv0_for_re_execing; | 2329 | *pp++ = (char *) G.argv0_for_re_execing; |
2324 | sprintf(param_buf, "-$%x:%x:%x" USE_HUSH_LOOPS(":%x") | ||
2325 | , (unsigned) G.root_pid | ||
2326 | , (unsigned) G.last_bg_pid | ||
2327 | , (unsigned) G.last_return_code | ||
2328 | USE_HUSH_LOOPS(, G.depth_of_loop) | ||
2329 | ); | ||
2330 | *pp++ = param_buf; | 2330 | *pp++ = param_buf; |
2331 | for (cur = G.top_var; cur; cur = cur->next) { | 2331 | for (cur = G.top_var; cur; cur = cur->next) { |
2332 | if (cur->varstr == hush_version_str) | 2332 | if (cur->varstr == hush_version_str) |