From ed058016bf8fc98271de2e58bfb650de9e9d304d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 6 Sep 2011 04:31:16 +0200 Subject: Apply post-1.19.1 patches, bump version to 1.19.2 Signed-off-by: Denys Vlasenko --- shell/hush.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'shell/hush.c') 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) #if ENABLE_FEATURE_EDITING G.line_input_state = new_line_input_t(FOR_SHELL); -# if defined MAX_HISTORY && MAX_HISTORY > 0 && ENABLE_HUSH_SAVEHISTORY +# if MAX_HISTORY > 0 && ENABLE_HUSH_SAVEHISTORY { const char *hp = get_local_var_value("HISTFILE"); if (!hp) { hp = get_local_var_value("HOME"); - if (hp) { - G.line_input_state->hist_file = concat_path_file(hp, ".hush_history"); - //set_local_var(xasprintf("HISTFILE=%s", ...)); - } + if (hp) + hp = concat_path_file(hp, ".hush_history"); + } else { + hp = xstrdup(hp); } -# if ENABLE_FEATURE_SH_HISTFILESIZE + if (hp) { + G.line_input_state->hist_file = hp; + //set_local_var(xasprintf("HISTFILE=%s", ...)); + } +# if ENABLE_FEATURE_SH_HISTFILESIZE hp = get_local_var_value("HISTFILESIZE"); G.line_input_state->max_history = size_from_HISTFILESIZE(hp); -# endif +# endif } # endif #endif -- cgit v1.2.3