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

Re: space quoting again



Andrej Borsenkow wrote:

> bor@itsrm2:~%> cd /a/s/S/4<TAB>
> bor@itsrm2:~%> cd /archive/sni/SAP R3/4.0B/

Forgot to quote the path prefix/suffix.

And then I found a place where I forgot to re-calculate the length of
the match added.

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Thu Jun 24 11:47:19 1999
+++ Src/Zle/zle_tricky.c	Thu Jun 24 14:43:42 1999
@@ -3816,6 +3816,10 @@
 		    lpre = quotename(lpre, NULL);
 		    lsuf = quotename(lsuf, NULL);
 		}
+		if (dat->ppre)
+		    dat->ppre = quotename(dat->ppre, NULL);
+		if (dat->psuf)
+		    dat->psuf = quotename(dat->psuf, NULL);
 	    }
 	    /* Walk through the matches given. */
 	    for (; (s = *argv); argv++) {
@@ -3841,8 +3845,10 @@
 		    }
 		}
 		if (!(dat->aflags & CAF_MATCH)) {
-		    ms = ((dat->aflags & CAF_QUOTE) ? dupstring(s) :
-			  quotename(s, NULL));
+		    if (dat->aflags & CAF_QUOTE)
+			ms = dupstring(s);
+		    else
+			sl = strlen(ms = quotename(s, NULL));
 		    lc = bld_parts(ms, sl, -1, NULL);
 		    isexact = 0;
 		} else if (!(ms = comp_match(lpre, lsuf, s, cp, &lc,

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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