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

Re: PATCH: crash completing after ~[]



On Mon, 29 Sep 2008 18:34:27 +0100
Peter Stephenson <pws@xxxxxxx> wrote:
> 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)

Oops.  pprog should be NULL in some cases.

Index: Src/params.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/params.c,v
retrieving revision 1.147
diff -u -r1.147 params.c
--- Src/params.c	29 Sep 2008 17:39:39 -0000	1.147
+++ Src/params.c	29 Sep 2008 20:40:20 -0000
@@ -1302,16 +1302,18 @@
 
 	if (v->isarr) {
 	    if (ishash) {
-		if (!pprog)
-		    return 1;
 		scanprog = pprog;
 		scanstr = s;
 		if (keymatch)
 		    v->isarr |= SCANPM_KEYMATCH;
-		else if (ind)
-		    v->isarr |= SCANPM_MATCHKEY;
-		else
-		    v->isarr |= SCANPM_MATCHVAL;
+		else {
+		    if (!pprog)
+			return 1;
+		    if (ind)
+			v->isarr |= SCANPM_MATCHKEY;
+		    else
+			v->isarr |= SCANPM_MATCHVAL;
+		}
 		if (down)
 		    v->isarr |= SCANPM_MATCHMANY;
 		if ((ta = getvaluearr(v)) &&


-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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