update busybox-power against BusyBox 1.20 release
[busybox-power] / debian / patches / 0001-lineedit-fix-history-saving-when-history-MAX_HISTORY.patch
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
5
6 ---
7  libbb/lineedit.c |    6 ++----
8  1 files changed, 2 insertions(+), 4 deletions(-)
9
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));
17                 idx = 0;
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') {
23                                 free(line);
24 @@ -1361,8 +1360,7 @@ static void load_history(line_input_t *st_parm)
25                         }
26                         free(temp_h[idx]);
27                         temp_h[idx] = line;
28 -                       if (!ENABLE_FEATURE_EDITING_SAVE_ON_EXIT)
29 -                               st_parm->cnt_history_in_file++;
30 +                       st_parm->cnt_history_in_file++;
31                         idx++;
32                         if (idx == st_parm->max_history)
33                                 idx = 0;
34 -- 
35 1.7.6.1
36