Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug with parameter expansion



Tanaka Akira wrote:

> In article <199911051251.NAA03010@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
>   Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> writes:
> 
> > Hm. As far as I know, even though `=' is in `SPECCHARS', it is only
> > special if it is at the beginning of a word. So the patch makes it be
> > quoted only then.
> 
> It's also special just after colon or equal when magicequalsubst is
> set.

Jesses. I really wasn't thinking, was I?

> Maybe, `~' should be treated as `='?

Yep.

Bye
 Sven

diff -u oldsrc/utils.c Src/utils.c
--- oldsrc/utils.c	Fri Nov  5 13:52:21 1999
+++ Src/utils.c	Fri Nov  5 16:07:09 1999
@@ -3073,7 +3073,10 @@
 	  }
 	  continue;
 	}
-	else if (ispecial(*u) && (*u != '=' || u == s) &&
+	else if (ispecial(*u) &&
+		 ((*u != '=' && *u != '~') ||
+		  (u == s || (isset(MAGICEQUALSUBST) &&
+			      (u[-1] == '=' || u[-1] == ':')))) &&
 	    (!instring ||
 	     (isset(BANGHIST) && *u == (char)bangchar) ||
 	     (instring == 2 &&

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author