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