ash: make a strdup copy of $HISTFILE for line editing
No binary (build failed)
—
(log yok)
| @@ -14499,7 +14499,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv) | |
| if (sflag || minusc == NULL) { | |
| #if MAX_HISTORY > 0 && ENABLE_FEATURE_EDITING_SAVEHISTORY | |
| - | if (iflag) { |
| + | if (line_input_state) { |
| const char *hp = lookupvar("HISTFILE"); | |
| if (!hp) { | |
| hp = lookupvar("HOME"); | |
| @@ -14513,7 +14513,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv) | |
| } | |
| } | |
| if (hp) | |
| - | line_input_state->hist_file = hp; |
| + | line_input_state->hist_file = xstrdup(hp); |
| # if ENABLE_FEATURE_SH_HISTFILESIZE | |
| hp = lookupvar("HISTFILESIZE"); | |
| line_input_state->max_history = size_from_HISTFILESIZE(hp); | |