zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: _urls, _netscape, a seg fault and new completion thoughts
Date: Thu, 14 Oct 1999 08:43:19 +0200 (MET DST)	[thread overview]
Message-ID: <199910140643.IAA13840@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Wed, 13 Oct 1999 16:09:00 +0000


Bart Schaefer wrote:

> Doesn't work for me either; not even the first bit that works for Oliver.
> I get a listing if I ask for one with ^D, but not with TAB, and automenu
> does not work if there's a quote on the line.  See:
> 
> ...
> 
> Doesn't matter if the command is ls, cd, bindkey ... unambiguous prefixes
> get inserted, but as soon as there's an ambiguity it all stops.

Ah, I didn't understand Oliver, sorry.

The problem was that in d_ambiguous() we test if the line changed or
not to decide if LIST_AMBIGUOUS should be used. But with a quote on the
original line, that quote was intermediately removed, but cline_str()
inserted the final string, so the comparison failed and it thought it
should use LIST_AMBIGUOUS (i.e. don't do anything further in that part 
of the code).

Bye
 Sven

diff -u oldsrc/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- oldsrc/Zle/zle_tricky.c	Wed Oct 13 16:17:37 1999
+++ Src/Zle/zle_tricky.c	Thu Oct 14 08:37:51 1999
@@ -66,7 +66,7 @@
 /* The line before completion was tried. */
 
 static char *origline;
-static int origcs;
+static int origcs, origll;
 
 /* wb and we hold the beginning/end position of the word we are completing. */
 
@@ -936,6 +936,7 @@
     ocs = cs;
     origline = dupstring((char *) line);
     origcs = cs;
+    origll = ll;
     if (!isfirstln && chline != NULL) {
 	/* If we are completing in a multi-line buffer (which was not  *
 	 * taken from the history), we have to prepend the stuff saved *
@@ -8272,15 +8273,11 @@
 	 * completion options.                                             */
 	do_ambig_menu();
     } else if (ainfo) {
-	int atend = (cs == we), oll = ll, la, eq, tcs;
-	VARARR(char, oline, ll);
+	int atend = (cs == we), la, eq, tcs;
 
 	minfo.cur = NULL;
 	minfo.asked = 0;
 
-	/* Copy the line buffer to be able to easily test if it changed. */
-	memcpy(oline, line, ll);
-
 	fixsuffix();
 
 	/* First remove the old string from the line. */
@@ -8299,7 +8296,7 @@
 	/* la is non-zero if listambiguous may be used. Copying and
 	 * comparing the line looks like BFI but it is the easiest
 	 * solution. Really. */
-	la = (ll != oll || strncmp(oline, (char *) line, ll));
+	la = (ll != origll || strncmp(origline, (char *) line, ll));
 
 	/* If REC_EXACT and AUTO_MENU are set and what we inserted is an  *
 	 * exact match, we want menu completion the next time round       *

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


             reply	other threads:[~1999-10-14  6:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-14  6:43 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-10-13 14:22 Sven Wischnowsky
1999-10-13 14:17 Sven Wischnowsky
1999-10-13 15:34 ` Oliver Kiddle
1999-10-13 16:09   ` Bart Schaefer
1999-10-13 16:37     ` Bart Schaefer
1999-10-13 12:11 Oliver Kiddle

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=199910140643.IAA13840@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).