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

PATCH: Re: Too much backslashing of quoted shriek?



Peter Stephenson wrote:

> fn() {
>   foo='Hi!'
>   print -r ${(qq)foo}
> }
> 
> % fn
> 'Hi\!'

That should be easy to fix.

Bye
 Sven

diff -ru ../z.old/Src/utils.c Src/utils.c
--- ../z.old/Src/utils.c	Fri Feb 18 15:42:14 2000
+++ Src/utils.c	Mon Feb 21 09:46:29 2000
@@ -2858,7 +2858,7 @@
 		  (isset(MAGICEQUALSUBST) && (u[-1] == '=' || u[-1] == ':')) ||
 		  (*u == '~' && isset(EXTENDEDGLOB))) &&
 	    (!instring ||
-	     (isset(BANGHIST) && *u == (char)bangchar) ||
+	     (isset(BANGHIST) && *u == (char)bangchar && instring != 1) ||
 	     (instring == 2 &&
 	      (*u == '$' || *u == '`' || *u == '\"' || *u == '\\')) ||
 	     (instring == 1 && *u == '\''))) {

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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