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

PATCH: crash completing after ~[]



I got the shell to crash when completing (actually an attempted
expansion) after "echo ~[]".  Apart from the suggestive command line,
this is actually unrelated to dynamic named directories.  The expansion
not surprising doesn't succeed anyway, so I haven't worried too much
(or at all) about what the shell code is doing that provokes this; it
appears to be an invalid pattern in a search through an associative
array, which is indeed not properly handled at this point.

Index: Src/params.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/params.c,v
retrieving revision 1.146
diff -u -r1.146 params.c
--- Src/params.c	13 Sep 2008 08:19:19 -0000	1.146
+++ Src/params.c	29 Sep 2008 17:29:49 -0000
@@ -1302,6 +1302,8 @@
 
 	if (v->isarr) {
 	    if (ishash) {
+		if (!pprog)
+		    return 1;
 		scanprog = pprog;
 		scanstr = s;
 		if (keymatch)

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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