From: Sven Wischnowsky <wischnow@berkom.de>
To: zsh-workers@sunsite.dk
Subject: Re: tab comlpetion bug
Date: Tue, 16 Apr 2002 09:50:32 +0200 [thread overview]
Message-ID: <15547.55240.210720.557459@wischnow.berkom.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0204121430030.23748-100000@ns1.sodaware.com>
Bart Schaefer wrote:
> On Fri, 12 Apr 2002, Jeremy M. Dolan wrote:
>
> > % cd "aaa\! <-- what zsh changes it to
> > *hit tab again*
> >
> > No matches found. It works ok if I don't put the " at the begining.
>
> It works if you "setopt no_bang_hist", or if you use single quotes (but
> note that if you're using the new completion system it won't work exactly
> as you have it there, because the argument to "cd" must be a directory).
>
> The problem is that inside the completion system zsh doesn't know that the
> backslash in front of the exclamation point is there solely for the
> purpose of preventing a history expansion. So it is trying to complete
> files whose names contain a literal backslash-bang.
I think the real bug was that the lexer code and get_comp_string()
still treated bangs in double quotes specially, even though history
expansion was already tried. Since this the non-special treatment *is*
special to the completion code the patch below make get_comp_string()
treat backslashed bangs in double quotes specially.
Bye
Sven
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.35
diff -u -r1.35 zle_tricky.c
--- Src/Zle/zle_tricky.c 13 Mar 2002 09:28:05 -0000 1.35
+++ Src/Zle/zle_tricky.c 16 Apr 2002 07:51:09 -0000
@@ -1404,6 +1404,12 @@
qisuf = n;
}
autoq = ztrdup(q);
+
+ if (instring == 2) {
+ for (q = s; *q; q++)
+ if (*q == '\\' && q[1] == '!')
+ *q = Bnull;
+ }
}
/* While building the quoted form, we also clean up the command line. */
for (p = s, tt = qword, i = wb, j = 0; *p; p++, tt++, i++)
--
Sven Wischnowsky wischnow@berkom.de
prev parent reply other threads:[~2002-04-16 7:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-12 21:23 Jeremy M. Dolan
2002-04-12 21:35 ` Bart Schaefer
2002-04-16 7:50 ` Sven Wischnowsky [this message]
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=15547.55240.210720.557459@wischnow.berkom.de \
--to=wischnow@berkom.de \
--cc=zsh-workers@sunsite.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).