1 Index: bash-4.4/lib/readline/history.c
2 ===================================================================
3 --- bash-4.4.orig/lib/readline/history.c
4 +++ bash-4.4/lib/readline/history.c
5 @@ -279,6 +279,7 @@ add_history (string)
11 if (history_stifled && (history_length == history_max_entries))
13 @@ -295,13 +296,9 @@ add_history (string)
15 /* Copy the rest of the entries, moving down one slot. Copy includes
18 - for (i = 0; i < history_length; i++)
19 - the_history[i] = the_history[i + 1];
21 memmove (the_history, the_history + 1, history_length * sizeof (HIST_ENTRY *));
24 + new_length = history_length;
28 @@ -315,7 +312,7 @@ add_history (string)
30 history_size = DEFAULT_HISTORY_INITIAL_SIZE;
31 the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *));
37 @@ -325,14 +322,15 @@ add_history (string)
38 the_history = (HIST_ENTRY **)
39 xrealloc (the_history, history_size * sizeof (HIST_ENTRY *));
42 + new_length = history_length + 1;
46 temp = alloc_history_entry ((char *)string, hist_inittime ());
48 - the_history[history_length] = (HIST_ENTRY *)NULL;
49 - the_history[history_length - 1] = temp;
50 + the_history[new_length] = (HIST_ENTRY *)NULL;
51 + the_history[new_length - 1] = temp;
52 + history_length = new_length;
55 /* Change the time stamp of the most recent history entry to STRING. */
56 Index: bash-4.4/patchlevel.h
57 ===================================================================
58 --- bash-4.4.orig/patchlevel.h
59 +++ bash-4.4/patchlevel.h
61 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
62 looks for to find the patch level (for the sccs version string). */
67 #endif /* _PATCHLEVEL_H_ */