diff options
Diffstat (limited to '')
-rw-r--r-- | shell/ash.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/shell/ash.c b/shell/ash.c index d12a483a3..eaaa71967 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -3658,13 +3658,18 @@ setsignal(int signo) | |||
3658 | switch (new_act) { | 3658 | switch (new_act) { |
3659 | case S_CATCH: | 3659 | case S_CATCH: |
3660 | act.sa_handler = signal_handler; | 3660 | act.sa_handler = signal_handler; |
3661 | act.sa_flags = 0; /* matters only if !DFL and !IGN */ | ||
3662 | sigfillset(&act.sa_mask); /* ditto */ | ||
3663 | break; | 3661 | break; |
3664 | case S_IGN: | 3662 | case S_IGN: |
3665 | act.sa_handler = SIG_IGN; | 3663 | act.sa_handler = SIG_IGN; |
3666 | break; | 3664 | break; |
3667 | } | 3665 | } |
3666 | |||
3667 | /* flags and mask matter only if !DFL and !IGN, but we do it | ||
3668 | * for all cases for more deterministic behavior: | ||
3669 | */ | ||
3670 | act.sa_flags = 0; | ||
3671 | sigfillset(&act.sa_mask); | ||
3672 | |||
3668 | sigaction_set(signo, &act); | 3673 | sigaction_set(signo, &act); |
3669 | 3674 | ||
3670 | *t = new_act; | 3675 | *t = new_act; |
@@ -13765,10 +13770,9 @@ int ash_main(int argc UNUSED_PARAM, char **argv) | |||
13765 | #if ENABLE_FEATURE_EDITING_SAVEHISTORY | 13770 | #if ENABLE_FEATURE_EDITING_SAVEHISTORY |
13766 | if (iflag) { | 13771 | if (iflag) { |
13767 | const char *hp = lookupvar("HISTFILE"); | 13772 | const char *hp = lookupvar("HISTFILE"); |
13768 | 13773 | if (!hp) { | |
13769 | if (hp == NULL) { | ||
13770 | hp = lookupvar("HOME"); | 13774 | hp = lookupvar("HOME"); |
13771 | if (hp != NULL) { | 13775 | if (hp) { |
13772 | char *defhp = concat_path_file(hp, ".ash_history"); | 13776 | char *defhp = concat_path_file(hp, ".ash_history"); |
13773 | setvar("HISTFILE", defhp, 0); | 13777 | setvar("HISTFILE", defhp, 0); |
13774 | free(defhp); | 13778 | free(defhp); |
@@ -13817,6 +13821,10 @@ int ash_main(int argc UNUSED_PARAM, char **argv) | |||
13817 | const char *hp = lookupvar("HISTFILE"); | 13821 | const char *hp = lookupvar("HISTFILE"); |
13818 | if (hp) | 13822 | if (hp) |
13819 | line_input_state->hist_file = hp; | 13823 | line_input_state->hist_file = hp; |
13824 | # if ENABLE_FEATURE_SH_HISTFILESIZE | ||
13825 | hp = lookupvar("HISTFILESIZE"); | ||
13826 | line_input_state->max_history = size_from_HISTFILESIZE(hp); | ||
13827 | # endif | ||
13820 | } | 13828 | } |
13821 | #endif | 13829 | #endif |
13822 | state4: /* XXX ??? - why isn't this before the "if" statement */ | 13830 | state4: /* XXX ??? - why isn't this before the "if" statement */ |