zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: fix for compadd without matching
@ 1999-02-19  9:53 Sven Wischnowsky
  0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 1999-02-19  9:53 UTC (permalink / raw)
  To: zsh-workers


This makes addmatches() use the right prefix string when it doesn't do 
matching. The cline list built was wrong with dire consequences
(anything from completely wrong strings to endless loops).

Bye
 Sven

--- os/Zle/zle_tricky.c	Fri Feb 19 10:03:56 1999
+++ Src/Zle/zle_tricky.c	Fri Feb 19 10:49:21 1999
@@ -3924,7 +3924,7 @@
 		} else {
 		    e = s;
 		    me = s + sl;
-		    pl = lpl;
+		    pl = sl;
 		}
 		/* Quoting? */
 		if (!(aflags & CAF_QUOTE)) {
@@ -3947,16 +3947,12 @@
 		    Cline *clp = &lc, tlc;
 		    char *ss = dupstring(s), *ee = me + (ss - s);
 
-		    if (lppre && *lppre) {
-			*clp = str_cline(lppre, strlen(lppre), &tlc);
-			clp = &(tlc->next);
-		    }
-		    if (pl) {
-			*clp = str_cline(ss, pl, &tlc);
+		    if (ppre && *ppre) {
+			*clp = str_cline(ppre, strlen(ppre), &tlc);
 			clp = &(tlc->next);
 		    }
 		    if (ee != ss + sl || (lpsuf && *lpsuf)) {
-			*clp = tlc = getcline(ss + pl, (ee - ss) - pl,
+			*clp = tlc = getcline(ss, ee - ss,
 					      NULL, 0, CLF_MID);
 			clp = &(tlc->next);
 			if (ee != ss + sl) {
@@ -3968,7 +3964,7 @@
 			    clp = &(tlc->next);
 			}
 		    } else {
-			*clp = tlc = getcline(NULL, 0, ss + pl, sl - pl,
+			*clp = tlc = getcline(NULL, 0, ss, sl,
 					      CLF_END | CLF_VAR);
 			clp = &(tlc->next);
 		    }

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-02-19  9:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-19  9:53 PATCH: fix for compadd without matching Sven Wischnowsky

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).