On 7/10/12 10:08 AM, Andreas Henriksson wrote:
> Hello,
> 
> Apologies if this bug has already been reported. :)
> 
> To reproduce the crash, in vi mode, type
> <ESC>dd.
> 
> I discovered the problem in bash, and confirmed that it was a readline
> problem with a minimal example. My readline version is 6.2.002 (as
> distributed in Arch Linux, if it helps).

It showed up on the RedHat bugzilla a little while ago, and I fixed it at
the beginning of June.  Try the attached patch and see if it works for you.
It fixes the problem for me.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    [email protected]    http://cnswww.cns.cwru.edu/~chet/


*** ../readline-6.2-patched/vi_mode.c	2011-02-25 11:17:02.000000000 -0500
--- vi_mode.c	2012-06-02 12:24:47.000000000 -0400
***************
*** 1235,1243 ****
        r = rl_domove_motion_callback (_rl_vimvcxt);
      }
!   else if (vi_redoing)
      {
        _rl_vimvcxt->motion = _rl_vi_last_motion;
        r = rl_domove_motion_callback (_rl_vimvcxt);
      }
  #if defined (READLINE_CALLBACKS)
    else if (RL_ISSTATE (RL_STATE_CALLBACK))
--- 1297,1313 ----
        r = rl_domove_motion_callback (_rl_vimvcxt);
      }
!   else if (vi_redoing && _rl_vi_last_motion != 'd')	/* `dd' is special */
      {
        _rl_vimvcxt->motion = _rl_vi_last_motion;
        r = rl_domove_motion_callback (_rl_vimvcxt);
      }
+   else if (vi_redoing)		/* handle redoing `dd' here */
+     {
+       _rl_vimvcxt->motion = _rl_vi_last_motion;
+       rl_mark = rl_end;
+       rl_beg_of_line (1, key);
+       RL_UNSETSTATE (RL_STATE_VIMOTION);
+       r = vidomove_dispatch (_rl_vimvcxt);
+     }
  #if defined (READLINE_CALLBACKS)
    else if (RL_ISSTATE (RL_STATE_CALLBACK))
***************
*** 1317,1325 ****
        r = rl_domove_motion_callback (_rl_vimvcxt);
      }
!   else if (vi_redoing)
      {
        _rl_vimvcxt->motion = _rl_vi_last_motion;
        r = rl_domove_motion_callback (_rl_vimvcxt);
      }
  #if defined (READLINE_CALLBACKS)
    else if (RL_ISSTATE (RL_STATE_CALLBACK))
--- 1387,1403 ----
        r = rl_domove_motion_callback (_rl_vimvcxt);
      }
!   else if (vi_redoing && _rl_vi_last_motion != 'c')	/* `cc' is special */
      {
        _rl_vimvcxt->motion = _rl_vi_last_motion;
        r = rl_domove_motion_callback (_rl_vimvcxt);
      }
+   else if (vi_redoing)		/* handle redoing `cc' here */
+     {
+       _rl_vimvcxt->motion = _rl_vi_last_motion;
+       rl_mark = rl_end;
+       rl_beg_of_line (1, key);
+       RL_UNSETSTATE (RL_STATE_VIMOTION);
+       r = vidomove_dispatch (_rl_vimvcxt);
+     }
  #if defined (READLINE_CALLBACKS)
    else if (RL_ISSTATE (RL_STATE_CALLBACK))
***************
*** 1378,1381 ****
--- 1456,1472 ----
        r = rl_domove_motion_callback (_rl_vimvcxt);
      }
+   else if (vi_redoing && _rl_vi_last_motion != 'y')	/* `yy' is special */
+     {
+       _rl_vimvcxt->motion = _rl_vi_last_motion;
+       r = rl_domove_motion_callback (_rl_vimvcxt);
+     }
+   else if (vi_redoing)			/* handle redoing `yy' here */
+     {
+       _rl_vimvcxt->motion = _rl_vi_last_motion;
+       rl_mark = rl_end;
+       rl_beg_of_line (1, key);
+       RL_UNSETSTATE (RL_STATE_VIMOTION);
+       r = vidomove_dispatch (_rl_vimvcxt);
+     }
  #if defined (READLINE_CALLBACKS)
    else if (RL_ISSTATE (RL_STATE_CALLBACK))
_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to