aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/shell/hush.c b/shell/hush.c
index e4138adf7..de0af9cec 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -7817,20 +7817,24 @@ int hush_main(int argc, char **argv)
7817 7817
7818#if ENABLE_FEATURE_EDITING 7818#if ENABLE_FEATURE_EDITING
7819 G.line_input_state = new_line_input_t(FOR_SHELL); 7819 G.line_input_state = new_line_input_t(FOR_SHELL);
7820# if defined MAX_HISTORY && MAX_HISTORY > 0 && ENABLE_HUSH_SAVEHISTORY 7820# if MAX_HISTORY > 0 && ENABLE_HUSH_SAVEHISTORY
7821 { 7821 {
7822 const char *hp = get_local_var_value("HISTFILE"); 7822 const char *hp = get_local_var_value("HISTFILE");
7823 if (!hp) { 7823 if (!hp) {
7824 hp = get_local_var_value("HOME"); 7824 hp = get_local_var_value("HOME");
7825 if (hp) { 7825 if (hp)
7826 G.line_input_state->hist_file = concat_path_file(hp, ".hush_history"); 7826 hp = concat_path_file(hp, ".hush_history");
7827 //set_local_var(xasprintf("HISTFILE=%s", ...)); 7827 } else {
7828 } 7828 hp = xstrdup(hp);
7829 } 7829 }
7830# if ENABLE_FEATURE_SH_HISTFILESIZE 7830 if (hp) {
7831 G.line_input_state->hist_file = hp;
7832 //set_local_var(xasprintf("HISTFILE=%s", ...));
7833 }
7834# if ENABLE_FEATURE_SH_HISTFILESIZE
7831 hp = get_local_var_value("HISTFILESIZE"); 7835 hp = get_local_var_value("HISTFILESIZE");
7832 G.line_input_state->max_history = size_from_HISTFILESIZE(hp); 7836 G.line_input_state->max_history = size_from_HISTFILESIZE(hp);
7833# endif 7837# endif
7834 } 7838 }
7835# endif 7839# endif
7836#endif 7840#endif