1 From 75e6cc9e70e426f7cdfd552585506360d7537f7c Mon Sep 17 00:00:00 2001
2 From: Dennis Groenen <tj.groenen@gmail.com>
3 Date: Wed, 7 Sep 2011 20:24:21 +0200
4 Subject: [PATCH 1/4] lineedit: fix history saving when history < MAX_HISTORY
7 libbb/lineedit.c | 6 ++----
8 1 files changed, 2 insertions(+), 4 deletions(-)
10 diff --git a/libbb/lineedit.c b/libbb/lineedit.c
11 index 603bbfc..a8b4609 100644
12 --- a/libbb/lineedit.c
13 +++ b/libbb/lineedit.c
14 @@ -1352,8 +1352,7 @@ static void load_history(line_input_t *st_parm)
15 /* fill temp_h[], retaining only last MAX_HISTORY lines */
16 memset(temp_h, 0, sizeof(temp_h));
18 - if (!ENABLE_FEATURE_EDITING_SAVE_ON_EXIT)
19 - st_parm->cnt_history_in_file = 0;
20 + st_parm->cnt_history_in_file = 0;
21 while ((line = xmalloc_fgetline(fp)) != NULL) {
22 if (line[0] == '\0') {
24 @@ -1361,8 +1360,7 @@ static void load_history(line_input_t *st_parm)
28 - if (!ENABLE_FEATURE_EDITING_SAVE_ON_EXIT)
29 - st_parm->cnt_history_in_file++;
30 + st_parm->cnt_history_in_file++;
32 if (idx == st_parm->max_history)