zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Bug in completion with menucomplete and no insertion
Date: Tue, 8 Jun 1999 08:58:02 +0200 (MET DST)	[thread overview]
Message-ID: <199906080658.IAA08430@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Peter Stephenson's message of Mon, 07 Jun 1999 17:21:21 +0200


Peter Stephenson wrote:

> Presumably something nasty is happening to memory somewhere before that
> point.  I checked and it's not even specific to -s: other mistakes in the
> get_compctl() called from bin_compgen() do the same thing.  The common
> factor seems to be that none of the commands produce matches or insert
> anything.  It seems to need menucomplete set as well; I've reproduced it
> after zsh -f, compinit, setopt nobeep menucomplete (nobeep is only
> necessary for sanity).

Right. For the quote-code I had to add to restore the command line
when no completion could be generated (because get_comp_string()
removes the quote from the line and changing that would have changed
all command line positions held by the completion code). It had
planned to look at this again and then forgot to do so.

> By the way, I've applied the following trivial patch to zle_tricky.c
> for shared-library purposes.

Oh no... I'm sorry.

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Mon Jun  7 13:00:08 1999
+++ Src/Zle/zle_tricky.c	Tue Jun  8 08:51:11 1999
@@ -66,7 +66,7 @@
 /* The line before completion was tried. */
 
 static char *origline;
-static int origll, origcs;
+static int origcs;
 
 /* wb and we hold the beginning/end position of the word we are completing. */
 
@@ -864,7 +864,6 @@
     /* Get the word to complete. */
     noerrs = 1;
     origline = dupstring((char *) line);
-    origll = ll;
     origcs = cs;
     s = get_comp_string();
     DPUTS(wb < 0 || cs < wb || cs > we,
@@ -4337,9 +4336,9 @@
 	/* Make sure we have the completion list and compctl. */
 	if (makecomplist(s, incmd, lst)) {
 	    /* Error condition: feeeeeeeeeeeeep(). */
-	    zsfree((char *) line);
-	    line = (unsigned char *) ztrdup(origline);
-	    ll = origll;
+	    cs = 0;
+	    foredel(ll);
+	    inststr(origline);
 	    cs = origcs;
 	    feep();
 	    clearlist = 1;

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


             reply	other threads:[~1999-06-08  7:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-08  6:58 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-06-07 15:21 Peter Stephenson

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=199906080658.IAA08430@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).