diff options
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 10265192e..5d139043a 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -1425,7 +1425,7 @@ static void save_history(char *str) | |||
1425 | 1425 | ||
1426 | /* write out temp file and replace hist_file atomically */ | 1426 | /* write out temp file and replace hist_file atomically */ |
1427 | new_name = xasprintf("%s.%u.new", state->hist_file, (int) getpid()); | 1427 | new_name = xasprintf("%s.%u.new", state->hist_file, (int) getpid()); |
1428 | fd = open(state->hist_file, O_WRONLY | O_CREAT | O_TRUNC, 0600); | 1428 | fd = open(new_name, O_WRONLY | O_CREAT | O_TRUNC, 0600); |
1429 | if (fd >= 0) { | 1429 | if (fd >= 0) { |
1430 | FILE *fp; | 1430 | FILE *fp; |
1431 | int i; | 1431 | int i; |
@@ -1475,7 +1475,7 @@ static void remember_in_history(char *str) | |||
1475 | /* i <= state->max_history */ | 1475 | /* i <= state->max_history */ |
1476 | state->cur_history = i; | 1476 | state->cur_history = i; |
1477 | state->cnt_history = i; | 1477 | state->cnt_history = i; |
1478 | # if MAX_HISTORY > 0 && ENABLE_FEATURE_EDITING_SAVEHISTORY | 1478 | # if ENABLE_FEATURE_EDITING_SAVEHISTORY |
1479 | if ((state->flags & SAVE_HISTORY) && state->hist_file) | 1479 | if ((state->flags & SAVE_HISTORY) && state->hist_file) |
1480 | save_history(str); | 1480 | save_history(str); |
1481 | # endif | 1481 | # endif |