update busybox-power against BusyBox 1.19.2 release
[busybox-power] / debian / patches / 0002-hush-don-t-save-history-when-non-interactive.patch
1 --- busybox-1.19.2.orig/shell/hush.c
2 +++ busybox-1.19.2/shell/hush.c
3 @@ -7831,6 +7831,7 @@ int hush_main(int argc, char **argv)
4                         G.line_input_state->hist_file = hp;
5                         //set_local_var(xasprintf("HISTFILE=%s", ...));
6                 }
7 +               G.line_input_state->flags &= ~SAVE_HISTORY; /* hush is non-interactive at this point */
8  #  if ENABLE_FEATURE_SH_HISTFILESIZE
9                 hp = get_local_var_value("HISTFILESIZE");
10                 G.line_input_state->max_history = size_from_HISTFILESIZE(hp);
11 @@ -8052,6 +8053,12 @@ int hush_main(int argc, char **argv)
12          *    standard output is a terminal
13          * Refer to Posix.2, the description of the 'sh' utility.
14          */
15 +#if ENABLE_FEATURE_EDITING
16 +# if defined MAX_HISTORY && MAX_HISTORY > 0 && ENABLE_HUSH_SAVEHISTORY
17 +       G.line_input_state->flags |= SAVE_HISTORY;
18 +# endif
19 +#endif
20 +
21  #if ENABLE_HUSH_JOB
22         if (isatty(STDIN_FILENO) && isatty(STDOUT_FILENO)) {
23                 G_saved_tty_pgrp = tcgetpgrp(STDIN_FILENO);