Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

{fore,back}del() fix for use in completion



-----BEGIN PGP SIGNED MESSAGE-----

When menu completing in beta18, each time the menu completion
reaches a completion with no special suffix, the last character
in the buffer gets duplicated.  This is because the foredel() and
backdel() functions are used in the completion code, but they now
do not expect the buffer to be NUL terminated.  The patch below
fixes this: they always move line[ll], which is harmless if the
buffer is not NUL terminated, because it's always big enough.

 -zefram

      Index: Src/zle_utils.c
      *** zle_utils.c	1996/05/18 06:52:44	1.5
      --- zle_utils.c	1996/05/23 13:07:53
      ***************
      *** 152,158 ****
        {
            int i = (cs -= ct);
        
      !     while (i + ct < ll) {
        	line[i] = line[i + ct];
        	i++;
            }
      --- 152,158 ----
        {
            int i = (cs -= ct);
        
      !     while (i + ct <= ll) {
        	line[i] = line[i + ct];
        	i++;
            }
      ***************
      *** 165,171 ****
        {
            int i = cs;
        
      !     while (i + ct < ll) {
        	line[i] = line[i + ct];
        	i++;
            }
      --- 165,171 ----
        {
            int i = cs;
        
      !     while (i + ct <= ll) {
        	line[i] = line[i + ct];
        	i++;
            }

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMaRmd3D/+HJTpU/hAQFbZQP/Y9+SU8EPMgWHPDRPqSAGWRsaob0Gfgww
MagkMN4dEeYY8e8VVyY3jc7t6DgAs8vJb2sXgjBkvR0Iy0WOcdIwyaW7dFxcDvb6
sAs7wGB+EFI8oDvwCj0OB5FbDTdJHO+9hfBipsyUgseeoh4Z4FBkjm1idtxrZYjD
6pZv9pO0/pc=
=IFrY
-----END PGP SIGNATURE-----




Messages sorted by: Reverse Date, Date, Thread, Author