bash-4.2-037.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.2
  4. Patch-ID: bash42-037
  5. Bug-Reported-by: Jakub Filak
  6. Bug-Reference-ID:
  7. Bug-Reference-URL: https://bugzilla.redhat.com/show_bug.cgi?id=813289
  8. Bug-Description:
  9. Attempting to redo (using `.') the vi editing mode `cc', `dd', or `yy'
  10. commands leads to an infinite loop.
  11. Patch (apply with `patch -p0'):
  12. *** ../bash-4.2-patched/lib/readline/vi_mode.c 2011-02-25 11:17:02.000000000 -0500
  13. --- ./lib/readline/vi_mode.c 2012-06-02 12:24:47.000000000 -0400
  14. ***************
  15. *** 1235,1243 ****
  16. r = rl_domove_motion_callback (_rl_vimvcxt);
  17. }
  18. ! else if (vi_redoing)
  19. {
  20. _rl_vimvcxt->motion = _rl_vi_last_motion;
  21. r = rl_domove_motion_callback (_rl_vimvcxt);
  22. }
  23. #if defined (READLINE_CALLBACKS)
  24. else if (RL_ISSTATE (RL_STATE_CALLBACK))
  25. --- 1297,1313 ----
  26. r = rl_domove_motion_callback (_rl_vimvcxt);
  27. }
  28. ! else if (vi_redoing && _rl_vi_last_motion != 'd') /* `dd' is special */
  29. {
  30. _rl_vimvcxt->motion = _rl_vi_last_motion;
  31. r = rl_domove_motion_callback (_rl_vimvcxt);
  32. }
  33. + else if (vi_redoing) /* handle redoing `dd' here */
  34. + {
  35. + _rl_vimvcxt->motion = _rl_vi_last_motion;
  36. + rl_mark = rl_end;
  37. + rl_beg_of_line (1, key);
  38. + RL_UNSETSTATE (RL_STATE_VIMOTION);
  39. + r = vidomove_dispatch (_rl_vimvcxt);
  40. + }
  41. #if defined (READLINE_CALLBACKS)
  42. else if (RL_ISSTATE (RL_STATE_CALLBACK))
  43. ***************
  44. *** 1317,1325 ****
  45. r = rl_domove_motion_callback (_rl_vimvcxt);
  46. }
  47. ! else if (vi_redoing)
  48. {
  49. _rl_vimvcxt->motion = _rl_vi_last_motion;
  50. r = rl_domove_motion_callback (_rl_vimvcxt);
  51. }
  52. #if defined (READLINE_CALLBACKS)
  53. else if (RL_ISSTATE (RL_STATE_CALLBACK))
  54. --- 1387,1403 ----
  55. r = rl_domove_motion_callback (_rl_vimvcxt);
  56. }
  57. ! else if (vi_redoing && _rl_vi_last_motion != 'c') /* `cc' is special */
  58. {
  59. _rl_vimvcxt->motion = _rl_vi_last_motion;
  60. r = rl_domove_motion_callback (_rl_vimvcxt);
  61. }
  62. + else if (vi_redoing) /* handle redoing `cc' here */
  63. + {
  64. + _rl_vimvcxt->motion = _rl_vi_last_motion;
  65. + rl_mark = rl_end;
  66. + rl_beg_of_line (1, key);
  67. + RL_UNSETSTATE (RL_STATE_VIMOTION);
  68. + r = vidomove_dispatch (_rl_vimvcxt);
  69. + }
  70. #if defined (READLINE_CALLBACKS)
  71. else if (RL_ISSTATE (RL_STATE_CALLBACK))
  72. ***************
  73. *** 1378,1381 ****
  74. --- 1456,1472 ----
  75. r = rl_domove_motion_callback (_rl_vimvcxt);
  76. }
  77. + else if (vi_redoing && _rl_vi_last_motion != 'y') /* `yy' is special */
  78. + {
  79. + _rl_vimvcxt->motion = _rl_vi_last_motion;
  80. + r = rl_domove_motion_callback (_rl_vimvcxt);
  81. + }
  82. + else if (vi_redoing) /* handle redoing `yy' here */
  83. + {
  84. + _rl_vimvcxt->motion = _rl_vi_last_motion;
  85. + rl_mark = rl_end;
  86. + rl_beg_of_line (1, key);
  87. + RL_UNSETSTATE (RL_STATE_VIMOTION);
  88. + r = vidomove_dispatch (_rl_vimvcxt);
  89. + }
  90. #if defined (READLINE_CALLBACKS)
  91. else if (RL_ISSTATE (RL_STATE_CALLBACK))
  92. *** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
  93. --- ./patchlevel.h Thu Feb 24 21:41:34 2011
  94. ***************
  95. *** 26,30 ****
  96. looks for to find the patch level (for the sccs version string). */
  97. ! #define PATCHLEVEL 36
  98. #endif /* _PATCHLEVEL_H_ */
  99. --- 26,30 ----
  100. looks for to find the patch level (for the sccs version string). */
  101. ! #define PATCHLEVEL 37
  102. #endif /* _PATCHLEVEL_H_ */