bash32-017 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 3.2
  4. Patch-ID: bash32-017
  5. Bug-Reported-by: Peter Volkov <torre_cremata@mail.ru>
  6. Bug-Reference-ID: <1173636022.7039.36.camel@localhost>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00039.html
  8. Bug-Description:
  9. When restoring the original prompt after finishing an incremental search,
  10. bash sometimes places the cursor incorrectly if the primary prompt contains
  11. invisible characters.
  12. Patch:
  13. *** ../bash-3.2.16/lib/readline/display.c Fri Apr 20 13:30:16 2007
  14. --- bash-3.2/lib/readline/display.c Fri Apr 20 15:17:01 2007
  15. ***************
  16. *** 1599,1604 ****
  17. if (temp > 0)
  18. {
  19. _rl_output_some_chars (nfd, temp);
  20. ! _rl_last_c_pos += _rl_col_width (nfd, 0, temp);;
  21. }
  22. }
  23. --- 1599,1618 ----
  24. if (temp > 0)
  25. {
  26. + /* If nfd begins at the prompt, or before the invisible
  27. + characters in the prompt, we need to adjust _rl_last_c_pos
  28. + in a multibyte locale to account for the wrap offset and
  29. + set cpos_adjusted accordingly. */
  30. _rl_output_some_chars (nfd, temp);
  31. ! if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
  32. ! {
  33. ! _rl_last_c_pos += _rl_col_width (nfd, 0, temp);
  34. ! if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
  35. ! {
  36. ! _rl_last_c_pos -= wrap_offset;
  37. ! cpos_adjusted = 1;
  38. ! }
  39. ! }
  40. ! else
  41. ! _rl_last_c_pos += temp;
  42. }
  43. }
  44. ***************
  45. *** 1608,1613 ****
  46. --- 1622,1639 ----
  47. if (temp > 0)
  48. {
  49. + /* If nfd begins at the prompt, or before the invisible
  50. + characters in the prompt, we need to adjust _rl_last_c_pos
  51. + in a multibyte locale to account for the wrap offset and
  52. + set cpos_adjusted accordingly. */
  53. _rl_output_some_chars (nfd, temp);
  54. _rl_last_c_pos += col_temp; /* XXX */
  55. + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
  56. + {
  57. + if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
  58. + {
  59. + _rl_last_c_pos -= wrap_offset;
  60. + cpos_adjusted = 1;
  61. + }
  62. + }
  63. }
  64. lendiff = (oe - old) - (ne - new);
  65. *** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006
  66. --- bash-3.2/patchlevel.h Mon Oct 16 14:22:54 2006
  67. ***************
  68. *** 26,30 ****
  69. looks for to find the patch level (for the sccs version string). */
  70. ! #define PATCHLEVEL 16
  71. #endif /* _PATCHLEVEL_H_ */
  72. --- 26,30 ----
  73. looks for to find the patch level (for the sccs version string). */
  74. ! #define PATCHLEVEL 17
  75. #endif /* _PATCHLEVEL_H_ */