zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: fix for compadd without matching
Date: Fri, 19 Feb 1999 10:53:02 +0100 (MET)	[thread overview]
Message-ID: <199902190953.KAA09886@beta.informatik.hu-berlin.de> (raw)


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


                 reply	other threads:[~1999-02-19  9:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199902190953.KAA09886@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).