diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-11-22 23:49:10 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-11-22 23:49:10 +0100 |
commit | 26777aa1c659b229f07205291241e45e64712a72 (patch) | |
tree | 9f145eef2fe8ffb957ab89ee2f6d0ea9dc7dbd2e /shell | |
parent | 29ca1591335b2a73522c2c3ef43daff63c71e8dc (diff) | |
download | busybox-w32-26777aa1c659b229f07205291241e45e64712a72.tar.gz busybox-w32-26777aa1c659b229f07205291241e45e64712a72.tar.bz2 busybox-w32-26777aa1c659b229f07205291241e45e64712a72.zip |
fixes for bugs discovered by randomconfig builds and tests
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 9 | ||||
-rw-r--r-- | shell/hush.c | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index 5ef7efbdb..5671a524b 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -43,7 +43,9 @@ | |||
43 | #include <sys/times.h> | 43 | #include <sys/times.h> |
44 | 44 | ||
45 | #include "shell_common.h" | 45 | #include "shell_common.h" |
46 | #include "math.h" | 46 | #if ENABLE_SH_MATH_SUPPORT |
47 | # include "math.h" | ||
48 | #endif | ||
47 | #if ENABLE_ASH_RANDOM_SUPPORT | 49 | #if ENABLE_ASH_RANDOM_SUPPORT |
48 | # include "random.h" | 50 | # include "random.h" |
49 | #else | 51 | #else |
@@ -5510,6 +5512,11 @@ static struct arglist exparg; | |||
5510 | /* | 5512 | /* |
5511 | * Our own itoa(). | 5513 | * Our own itoa(). |
5512 | */ | 5514 | */ |
5515 | #if !ENABLE_SH_MATH_SUPPORT | ||
5516 | /* cvtnum() is used even if math support is off (to prepare $? values and such) */ | ||
5517 | typedef long arith_t; | ||
5518 | # define ARITH_FMT "%ld" | ||
5519 | #endif | ||
5513 | static int | 5520 | static int |
5514 | cvtnum(arith_t num) | 5521 | cvtnum(arith_t num) |
5515 | { | 5522 | { |
diff --git a/shell/hush.c b/shell/hush.c index da32c2435..26a50744e 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -712,11 +712,11 @@ struct globals { | |||
712 | int last_jobid; | 712 | int last_jobid; |
713 | pid_t saved_tty_pgrp; | 713 | pid_t saved_tty_pgrp; |
714 | struct pipe *job_list; | 714 | struct pipe *job_list; |
715 | char o_opt[NUM_OPT_O]; | ||
716 | # define G_saved_tty_pgrp (G.saved_tty_pgrp) | 715 | # define G_saved_tty_pgrp (G.saved_tty_pgrp) |
717 | #else | 716 | #else |
718 | # define G_saved_tty_pgrp 0 | 717 | # define G_saved_tty_pgrp 0 |
719 | #endif | 718 | #endif |
719 | char o_opt[NUM_OPT_O]; | ||
720 | smallint flag_SIGINT; | 720 | smallint flag_SIGINT; |
721 | #if ENABLE_HUSH_LOOPS | 721 | #if ENABLE_HUSH_LOOPS |
722 | smallint flag_break_continue; | 722 | smallint flag_break_continue; |
@@ -4500,7 +4500,9 @@ static struct pipe *parse_stream(char **pstring, | |||
4500 | expand_string_to_string(str) | 4500 | expand_string_to_string(str) |
4501 | #endif | 4501 | #endif |
4502 | static char *expand_string_to_string(const char *str, int do_unbackslash); | 4502 | static char *expand_string_to_string(const char *str, int do_unbackslash); |
4503 | #if ENABLE_HUSH_TICK | ||
4503 | static int process_command_subs(o_string *dest, const char *s); | 4504 | static int process_command_subs(o_string *dest, const char *s); |
4505 | #endif | ||
4504 | 4506 | ||
4505 | /* expand_strvec_to_strvec() takes a list of strings, expands | 4507 | /* expand_strvec_to_strvec() takes a list of strings, expands |
4506 | * all variable references within and returns a pointer to | 4508 | * all variable references within and returns a pointer to |
@@ -6579,7 +6581,7 @@ static int checkjobs_and_fg_shell(struct pipe *fg_pipe) | |||
6579 | * subshell: ( list ) [&] | 6581 | * subshell: ( list ) [&] |
6580 | */ | 6582 | */ |
6581 | #if !ENABLE_HUSH_MODE_X | 6583 | #if !ENABLE_HUSH_MODE_X |
6582 | #define redirect_and_varexp_helper(new_env_p, old_vars_p, command, squirrel, char argv_expanded) \ | 6584 | #define redirect_and_varexp_helper(new_env_p, old_vars_p, command, squirrel, argv_expanded) \ |
6583 | redirect_and_varexp_helper(new_env_p, old_vars_p, command, squirrel) | 6585 | redirect_and_varexp_helper(new_env_p, old_vars_p, command, squirrel) |
6584 | #endif | 6586 | #endif |
6585 | static int redirect_and_varexp_helper(char ***new_env_p, | 6587 | static int redirect_and_varexp_helper(char ***new_env_p, |