bash31-014 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 3.1
  4. Patch-ID: bash31-014
  5. Bug-Reported-by: Mike Stroyan <mike.stroyan@hp.com>
  6. Bug-Reference-ID: <20060203191607.GC27614@localhost>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2006-02/msg00004.html
  8. Bug-Description:
  9. The displayed search prompt is corrupted when using non-incremental
  10. searches in vi and emacs mode if the prompt contains non-printing
  11. characters or spans multiple lines. The prompt is expanded more than
  12. once; the second time without the escape sequences that protect non-
  13. printing characters from the length calculations.
  14. Patch:
  15. *** bash-3.1-patched/lib/readline/display.c Wed Nov 30 14:05:02 2005
  16. --- bash-3.1/lib/readline/display.c Sat Feb 18 12:14:58 2006
  17. ***************
  18. *** 1983,1993 ****
  19. int pchar;
  20. {
  21. int len;
  22. ! char *pmt;
  23. rl_save_prompt ();
  24. ! if (saved_local_prompt == 0)
  25. {
  26. len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
  27. pmt = (char *)xmalloc (len + 2);
  28. --- 1998,2012 ----
  29. int pchar;
  30. {
  31. int len;
  32. ! char *pmt, *p;
  33. rl_save_prompt ();
  34. ! /* We've saved the prompt, and can do anything with the various prompt
  35. ! strings we need before they're restored. We want the unexpanded
  36. ! portion of the prompt string after any final newline. */
  37. ! p = rl_prompt ? strrchr (rl_prompt, '\n') : 0;
  38. ! if (p == 0)
  39. {
  40. len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
  41. pmt = (char *)xmalloc (len + 2);
  42. ***************
  43. *** 1998,2016 ****
  44. }
  45. else
  46. {
  47. ! len = *saved_local_prompt ? strlen (saved_local_prompt) : 0;
  48. pmt = (char *)xmalloc (len + 2);
  49. if (len)
  50. ! strcpy (pmt, saved_local_prompt);
  51. pmt[len] = pchar;
  52. pmt[len+1] = '\0';
  53. ! local_prompt = savestring (pmt);
  54. ! prompt_last_invisible = saved_last_invisible;
  55. ! prompt_visible_length = saved_visible_length + 1;
  56. ! }
  57. prompt_physical_chars = saved_physical_chars + 1;
  58. -
  59. return pmt;
  60. }
  61. --- 2017,2033 ----
  62. }
  63. else
  64. {
  65. ! p++;
  66. ! len = strlen (p);
  67. pmt = (char *)xmalloc (len + 2);
  68. if (len)
  69. ! strcpy (pmt, p);
  70. pmt[len] = pchar;
  71. pmt[len+1] = '\0';
  72. ! }
  73. + /* will be overwritten by expand_prompt, called from rl_message */
  74. prompt_physical_chars = saved_physical_chars + 1;
  75. return pmt;
  76. }
  77. *** bash-3.1/patchlevel.h Wed Jul 20 13:58:20 2005
  78. --- bash-3.1/patchlevel.h Wed Dec 7 13:48:42 2005
  79. ***************
  80. *** 26,30 ****
  81. looks for to find the patch level (for the sccs version string). */
  82. ! #define PATCHLEVEL 13
  83. #endif /* _PATCHLEVEL_H_ */
  84. --- 26,30 ----
  85. looks for to find the patch level (for the sccs version string). */
  86. ! #define PATCHLEVEL 14
  87. #endif /* _PATCHLEVEL_H_ */