bash30-009 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 3.0
  4. Patch-ID: bash30-009
  5. Bug-Reported-by: Tim Waugh <twaugh@redhat.com>
  6. Bug-Reference-ID: <20040810083805.GT2177@redhat.com>
  7. Bug-Reference-URL: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=129526b
  8. http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00116.html
  9. Bug-Description:
  10. -->
  11. Steps to Reproduce:
  12. 1. Launch a bash shell
  13. 2. Set editing mode to 'vi' with 'set -o vi'
  14. 3. Type any command, but don't hit return
  15. 4. Enter vi-command mode by hitting the escape key
  16. 5. Go to the end of line with the '$' command
  17. 6. Type 'r' to change the last character
  18. 7. Type any character (other than what the character already is)
  19. The last two characters are inexplicably swapped
  20. after the last character is changed.
  21. <--
  22. Patch:
  23. *** ../bash-3.0/lib/readline/vi_mode.c Tue Jul 13 14:08:27 2004
  24. --- lib/readline/vi_mode.c Tue Aug 17 00:12:09 2004
  25. ***************
  26. *** 691,695 ****
  27. wchar_t wc;
  28. char mb[MB_LEN_MAX+1];
  29. ! int mblen;
  30. mbstate_t ps;
  31. --- 693,697 ----
  32. wchar_t wc;
  33. char mb[MB_LEN_MAX+1];
  34. ! int mblen, p;
  35. mbstate_t ps;
  36. ***************
  37. *** 714,722 ****
  38. if (wc)
  39. {
  40. mblen = wcrtomb (mb, wc, &ps);
  41. if (mblen >= 0)
  42. mb[mblen] = '\0';
  43. rl_begin_undo_group ();
  44. ! rl_delete (1, 0);
  45. rl_insert_text (mb);
  46. rl_end_undo_group ();
  47. --- 716,727 ----
  48. if (wc)
  49. {
  50. + p = rl_point;
  51. mblen = wcrtomb (mb, wc, &ps);
  52. if (mblen >= 0)
  53. mb[mblen] = '\0';
  54. rl_begin_undo_group ();
  55. ! rl_vi_delete (1, 0);
  56. ! if (rl_point < p) /* Did we retreat at EOL? */
  57. ! rl_point++; /* XXX - should we advance more than 1 for mbchar? */
  58. rl_insert_text (mb);
  59. rl_end_undo_group ();
  60. ***************
  61. *** 1311,1320 ****
  62. #if defined (HANDLE_MULTIBYTE)
  63. if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
  64. ! while (_rl_insert_char (1, c))
  65. ! {
  66. ! RL_SETSTATE (RL_STATE_MOREINPUT);
  67. ! c = rl_read_key ();
  68. ! RL_UNSETSTATE (RL_STATE_MOREINPUT);
  69. ! }
  70. else
  71. #endif
  72. --- 1316,1329 ----
  73. #if defined (HANDLE_MULTIBYTE)
  74. if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
  75. ! {
  76. ! if (rl_point < p) /* Did we retreat at EOL? */
  77. ! rl_point++;
  78. ! while (_rl_insert_char (1, c))
  79. ! {
  80. ! RL_SETSTATE (RL_STATE_MOREINPUT);
  81. ! c = rl_read_key ();
  82. ! RL_UNSETSTATE (RL_STATE_MOREINPUT);
  83. ! }
  84. ! }
  85. else
  86. #endif
  87. *** ../bash-3.0/patchlevel.h Wed Aug 22 08:05:39 2001
  88. --- patchlevel.h Thu Sep 2 15:04:32 2004
  89. ***************
  90. *** 26,30 ****
  91. looks for to find the patch level (for the sccs version string). */
  92. ! #define PATCHLEVEL 8
  93. #endif /* _PATCHLEVEL_H_ */
  94. --- 26,30 ----
  95. looks for to find the patch level (for the sccs version string). */
  96. ! #define PATCHLEVEL 9
  97. #endif /* _PATCHLEVEL_H_ */