0012-bash50-012.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From https://ftp.gnu.org/gnu/bash/bash-5.0-patches/bash50-012
  2. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. BASH PATCH REPORT
  4. =================
  5. Bash-Release: 5.0
  6. Patch-ID: bash50-012
  7. Bug-Reported-by: lessbug@qq.com
  8. Bug-Reference-ID: <tencent_6AA531D9A5CC4121D86BD5CDA2E0DA98C605@qq.com>
  9. Bug-Reference-URL:
  10. Bug-Description:
  11. When using previous-history to go back beyond the beginning of the history list,
  12. it's possible to move to an incorrect partial line.
  13. Patch (apply with `patch -p0'):
  14. *** ../bash-5.0-patched/lib/readline/misc.c 2017-07-07 17:30:12.000000000 -0400
  15. --- b/lib/readline/misc.c 2019-05-16 11:43:46.000000000 -0400
  16. ***************
  17. *** 577,580 ****
  18. --- 590,594 ----
  19. {
  20. HIST_ENTRY *old_temp, *temp;
  21. + int had_saved_line;
  22. if (count < 0)
  23. ***************
  24. *** 589,592 ****
  25. --- 603,607 ----
  26. /* If we don't have a line saved, then save this one. */
  27. + had_saved_line = _rl_saved_line_for_history != 0;
  28. rl_maybe_save_line ();
  29. ***************
  30. *** 612,616 ****
  31. if (temp == 0)
  32. {
  33. ! rl_maybe_unsave_line ();
  34. rl_ding ();
  35. }
  36. --- 627,632 ----
  37. if (temp == 0)
  38. {
  39. ! if (had_saved_line == 0)
  40. ! _rl_free_saved_history_line ();
  41. rl_ding ();
  42. }
  43. *** ../bash-5.0/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
  44. --- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400
  45. ***************
  46. *** 26,30 ****
  47. looks for to find the patch level (for the sccs version string). */
  48. ! #define PATCHLEVEL 11
  49. #endif /* _PATCHLEVEL_H_ */
  50. --- 26,30 ----
  51. looks for to find the patch level (for the sccs version string). */
  52. ! #define PATCHLEVEL 12
  53. #endif /* _PATCHLEVEL_H_ */