462fb2
			     BASH PATCH REPORT
462fb2
			     =================
462fb2
462fb2
Bash-Release:	4.2
462fb2
Patch-ID:	bash42-037
462fb2
462fb2
Bug-Reported-by:	Jakub Filak
462fb2
Bug-Reference-ID:
462fb2
Bug-Reference-URL:	https://bugzilla.redhat.com/show_bug.cgi?id=813289
462fb2
462fb2
Bug-Description:
462fb2
462fb2
Attempting to redo (using `.') the vi editing mode `cc', `dd', or `yy'
462fb2
commands leads to an infinite loop.
462fb2
462fb2
Patch (apply with `patch -p0'):
462fb2
462fb2
*** ../bash-4.2-patched/lib/readline/vi_mode.c	2011-02-25 11:17:02.000000000 -0500
462fb2
--- lib/readline/vi_mode.c	2012-06-02 12:24:47.000000000 -0400
462fb2
***************
462fb2
*** 1235,1243 ****
462fb2
        r = rl_domove_motion_callback (_rl_vimvcxt);
462fb2
      }
462fb2
!   else if (vi_redoing)
462fb2
      {
462fb2
        _rl_vimvcxt->motion = _rl_vi_last_motion;
462fb2
        r = rl_domove_motion_callback (_rl_vimvcxt);
462fb2
      }
462fb2
  #if defined (READLINE_CALLBACKS)
462fb2
    else if (RL_ISSTATE (RL_STATE_CALLBACK))
462fb2
--- 1297,1313 ----
462fb2
        r = rl_domove_motion_callback (_rl_vimvcxt);
462fb2
      }
462fb2
!   else if (vi_redoing && _rl_vi_last_motion != 'd')	/* `dd' is special */
462fb2
      {
462fb2
        _rl_vimvcxt->motion = _rl_vi_last_motion;
462fb2
        r = rl_domove_motion_callback (_rl_vimvcxt);
462fb2
      }
462fb2
+   else if (vi_redoing)		/* handle redoing `dd' here */
462fb2
+     {
462fb2
+       _rl_vimvcxt->motion = _rl_vi_last_motion;
462fb2
+       rl_mark = rl_end;
462fb2
+       rl_beg_of_line (1, key);
462fb2
+       RL_UNSETSTATE (RL_STATE_VIMOTION);
462fb2
+       r = vidomove_dispatch (_rl_vimvcxt);
462fb2
+     }
462fb2
  #if defined (READLINE_CALLBACKS)
462fb2
    else if (RL_ISSTATE (RL_STATE_CALLBACK))
462fb2
***************
462fb2
*** 1317,1325 ****
462fb2
        r = rl_domove_motion_callback (_rl_vimvcxt);
462fb2
      }
462fb2
!   else if (vi_redoing)
462fb2
      {
462fb2
        _rl_vimvcxt->motion = _rl_vi_last_motion;
462fb2
        r = rl_domove_motion_callback (_rl_vimvcxt);
462fb2
      }
462fb2
  #if defined (READLINE_CALLBACKS)
462fb2
    else if (RL_ISSTATE (RL_STATE_CALLBACK))
462fb2
--- 1387,1403 ----
462fb2
        r = rl_domove_motion_callback (_rl_vimvcxt);
462fb2
      }
462fb2
!   else if (vi_redoing && _rl_vi_last_motion != 'c')	/* `cc' is special */
462fb2
      {
462fb2
        _rl_vimvcxt->motion = _rl_vi_last_motion;
462fb2
        r = rl_domove_motion_callback (_rl_vimvcxt);
462fb2
      }
462fb2
+   else if (vi_redoing)		/* handle redoing `cc' here */
462fb2
+     {
462fb2
+       _rl_vimvcxt->motion = _rl_vi_last_motion;
462fb2
+       rl_mark = rl_end;
462fb2
+       rl_beg_of_line (1, key);
462fb2
+       RL_UNSETSTATE (RL_STATE_VIMOTION);
462fb2
+       r = vidomove_dispatch (_rl_vimvcxt);
462fb2
+     }
462fb2
  #if defined (READLINE_CALLBACKS)
462fb2
    else if (RL_ISSTATE (RL_STATE_CALLBACK))
462fb2
***************
462fb2
*** 1378,1381 ****
462fb2
--- 1456,1472 ----
462fb2
        r = rl_domove_motion_callback (_rl_vimvcxt);
462fb2
      }
462fb2
+   else if (vi_redoing && _rl_vi_last_motion != 'y')	/* `yy' is special */
462fb2
+     {
462fb2
+       _rl_vimvcxt->motion = _rl_vi_last_motion;
462fb2
+       r = rl_domove_motion_callback (_rl_vimvcxt);
462fb2
+     }
462fb2
+   else if (vi_redoing)			/* handle redoing `yy' here */
462fb2
+     {
462fb2
+       _rl_vimvcxt->motion = _rl_vi_last_motion;
462fb2
+       rl_mark = rl_end;
462fb2
+       rl_beg_of_line (1, key);
462fb2
+       RL_UNSETSTATE (RL_STATE_VIMOTION);
462fb2
+       r = vidomove_dispatch (_rl_vimvcxt);
462fb2
+     }
462fb2
  #if defined (READLINE_CALLBACKS)
462fb2
    else if (RL_ISSTATE (RL_STATE_CALLBACK))
462fb2
*** ../bash-4.2-patched/patchlevel.h	Sat Jun 12 20:14:48 2010
462fb2
--- patchlevel.h	Thu Feb 24 21:41:34 2011
462fb2
***************
462fb2
*** 26,30 ****
462fb2
     looks for to find the patch level (for the sccs version string). */
462fb2
  
462fb2
! #define PATCHLEVEL 36
462fb2
  
462fb2
  #endif /* _PATCHLEVEL_H_ */
462fb2
--- 26,30 ----
462fb2
     looks for to find the patch level (for the sccs version string). */
462fb2
  
462fb2
! #define PATCHLEVEL 37
462fb2
  
462fb2
  #endif /* _PATCHLEVEL_H_ */