You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.0 KiB

  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)
  6. const char *string;
  7. {
  8. HIST_ENTRY *temp;
  9. + int new_length;
  10. if (history_stifled && (history_length == history_max_entries))
  11. {
  12. @@ -295,13 +296,9 @@ add_history (string)
  13. /* Copy the rest of the entries, moving down one slot. Copy includes
  14. trailing NULL. */
  15. -#if 0
  16. - for (i = 0; i < history_length; i++)
  17. - the_history[i] = the_history[i + 1];
  18. -#else
  19. memmove (the_history, the_history + 1, history_length * sizeof (HIST_ENTRY *));
  20. -#endif
  21. + new_length = history_length;
  22. history_base++;
  23. }
  24. else
  25. @@ -315,7 +312,7 @@ add_history (string)
  26. else
  27. history_size = DEFAULT_HISTORY_INITIAL_SIZE;
  28. the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *));
  29. - history_length = 1;
  30. + new_length = 1;
  31. }
  32. else
  33. {
  34. @@ -325,14 +322,15 @@ add_history (string)
  35. the_history = (HIST_ENTRY **)
  36. xrealloc (the_history, history_size * sizeof (HIST_ENTRY *));
  37. }
  38. - history_length++;
  39. + new_length = history_length + 1;
  40. }
  41. }
  42. temp = alloc_history_entry ((char *)string, hist_inittime ());
  43. - the_history[history_length] = (HIST_ENTRY *)NULL;
  44. - the_history[history_length - 1] = temp;
  45. + the_history[new_length] = (HIST_ENTRY *)NULL;
  46. + the_history[new_length - 1] = temp;
  47. + history_length = new_length;
  48. }
  49. /* Change the time stamp of the most recent history entry to STRING. */
  50. Index: bash-4.4/patchlevel.h
  51. ===================================================================
  52. --- bash-4.4.orig/patchlevel.h
  53. +++ bash-4.4/patchlevel.h
  54. @@ -25,6 +25,6 @@
  55. regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
  56. looks for to find the patch level (for the sccs version string). */
  57. -#define PATCHLEVEL 8
  58. +#define PATCHLEVEL 9
  59. #endif /* _PATCHLEVEL_H_ */