summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko2011-09-06 04:31:16 +0200
committerDenys Vlasenko2011-09-06 04:31:16 +0200
commited058016bf8fc98271de2e58bfb650de9e9d304d (patch)
treeb6554880a7224a86c27429aaebfa6a5b16349b59 /shell
parentcc272b06eefb87030bb85b686abdbc22b5ed1c34 (diff)
downloadbusybox-ed058016bf8fc98271de2e58bfb650de9e9d304d.zip
busybox-ed058016bf8fc98271de2e58bfb650de9e9d304d.tar.gz
Apply post-1.19.1 patches, bump version to 1.19.21_19_2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/shell/hush.c b/shell/hush.c
index e4138ad..de0af9c 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