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

Re: Completion bug introduced in 3.0.3



On Jul 2,  5:48am, Ingo Wilken wrote:
} Subject: Completion bug introduced in 3.0.3
}
} Hi,
} 
} I just upgraded from zsh 3.0.0 to 3.0.4 and noticed a severe bug with
} filename completion in multiple-line commands.  I build all intermediate
} versions, and noticed that this bug was introduced with 3.0.3.

On Jul 2,  4:41am, Geoff Wing wrote:
} Subject: Re: Completion bug introduced in 3.0.3
}
} Reproduced gives:
} BUG: xorrec: ll != strlen(line)
} 
} Hopefully shouldn't be too hard for someone to find (someone else, that is :-)

I've confirmed that this bug is fixed by the patch to zle_utils.c that
PWS sent some days ago, which properly nul-terminates the `line' string.
My debugging version had the patch, my regular one did not, which is why
I was not able to reproduce with debugging.

Here's the patch again, against 3.0.4 instead of 3.1.2.

Index: Src/zle_utils.c
===================================================================
--- zle_utils.c	1997/06/27 18:37:08	1.1.1.3
+++ zle_utils.c	1997/06/29 02:21:59	1.4
@@ -73,7 +73,7 @@
 	line[to] = line[to + cnt];
 	to++;
     }
-    ll = to;
+    line[ll = to] = '\0';
 }
 
 /**/

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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