zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: completion fixes
Date: Thu, 18 Feb 1999 15:53:54 +0100 (MET)	[thread overview]
Message-ID: <199902181453.PAA08362@beta.informatik.hu-berlin.de> (raw)


There was a little memory freeing problem (with the list of free cline 
structs, if anyone knows what I'm talking about...). Also, in
addmatches() (a.k.a. almost compadd) the suffix-calculation could fail 
when used without matching.

Bye
 Sven

--- os/Zle/zle_tricky.c	Thu Feb 18 10:01:27 1999
+++ Src/Zle/zle_tricky.c	Thu Feb 18 15:40:36 1999
@@ -2716,6 +2716,8 @@
 	Cline f = freecl, q, op = NULL;
 	int ol, nl;
 
+	freecl = NULL;
+
 	while (o && n) {
 	    /* CLF_MID is set in the cline struct where the prefix and the
 	     * suffix from the line meet. If we have reached the cline
@@ -3777,7 +3779,7 @@
 	   char *suf, char *group, char *rems, char *remf, char *ign,
 	   int flags, int aflags, Cmatcher match, char **argv)
 {
-    char *s, *t, *e, *te, *ms, *lipre = NULL, *lpre, *lsuf, **aign = NULL;
+    char *s, *t, *e, *me, *te, *ms, *lipre = NULL, *lpre, *lsuf, **aign = NULL;
     int lpl, lsl, i, pl, sl, test, bpl, bsl, lsm, llpl;
     Aminfo ai;
     Cline lc = NULL;
@@ -3881,6 +3883,7 @@
 	    /* Walk through the matches given. */
 	    for (; (s = dupstring(*argv)); argv++) {
 		sl = strlen(s);
+		lc = NULL;
 		ms = NULL;
 		bpl = brpl;
 		bsl = brsl;
@@ -3917,9 +3920,10 @@
 			test = 1;
 		    if (!test)
 			continue;
-		    e = s + sl;
+		    me = e = s + sl;
 		} else {
 		    e = s;
+		    me = s + sl;
 		    pl = lpl;
 		}
 		/* Quoting? */
@@ -3941,7 +3945,7 @@
 		    t = dyncat(ppre, t);
 		if (!ms && mstack) {
 		    Cline *clp = &lc, tlc;
-		    char *ss = dupstring(s), *ee = e + (ss - s);
+		    char *ss = dupstring(s), *ee = me + (ss - s);
 
 		    if (lppre && *lppre) {
 			*clp = str_cline(lppre, strlen(lppre), &tlc);

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


                 reply	other threads:[~1999-02-18 14:55 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=199902181453.PAA08362@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).