Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug with parameter expansion
- X-seq: zsh-workers 8573
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Bug with parameter expansion
- Date: Fri, 5 Nov 1999 16:48:21 +0100 (MET)
- In-reply-to: Zefram's message of Fri, 5 Nov 1999 15:20:20 +0000 (GMT)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Zefram wrote:
> Sven Wischnowsky wrote:
> >Tanaka Akira wrote:
> >> Maybe, `~' should be treated as `='?
> >
> >Yep.
>
> Nope. ~ in the middle of a word is special if EXTENDED_GLOB is set.
I was about to say:
I had exactly the same idea, had written the mail and the patch this
way and then checked. The `~' is only special if there are other glob
special characters. So I didn't change it.
... but of course, this isn't correct because bslashquote() doesn't
test if there are other special characters. Oh well...
Bye
Sven
diff -u oldsrc/utils.c Src/utils.c
--- oldsrc/utils.c Fri Nov 5 16:45:51 1999
+++ Src/utils.c Fri Nov 5 16:46:19 1999
@@ -3075,8 +3075,9 @@
}
else if (ispecial(*u) &&
((*u != '=' && *u != '~') ||
- (u == s || (isset(MAGICEQUALSUBST) &&
- (u[-1] == '=' || u[-1] == ':')))) &&
+ u == s ||
+ (isset(MAGICEQUALSUBST) && (u[-1] == '=' || u[-1] == ':')) ||
+ (*u == '~' && isset(EXTENDEDGLOB))) &&
(!instring ||
(isset(BANGHIST) && *u == (char)bangchar) ||
(instring == 2 &&
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author