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

Re: Test version before zsh 5.4



On Thu, 3 Aug 2017 19:57:04 +0200
Martijn Dekker <martijn@xxxxxxxx> wrote:
> Op 03-08-17 om 18:00 schreef Martijn Dekker:
> > I found a problem with the shell's generation of C-style shell-quoted
> > strings ($'...').
> > 
> > % testvar=$'one\\two\n'
> > breedzicht% set|grep ^testvar
> > testvar=$'one\two\n'
> > 
> > The backslash is not escaped properly.
> 
> A simple fix is attached.

Thanks, here's a test.

pws

diff --git a/Test/A03quoting.ztst b/Test/A03quoting.ztst
index da3ce35..be9ca66 100644
--- a/Test/A03quoting.ztst
+++ b/Test/A03quoting.ztst
@@ -78,3 +78,8 @@
  () { print $# } '' "" $''
 0:$'' should not be elided, in common with other empty quotes
 >3
+
+ foo=$'one\\two\n\'buckle\'\tmy\\shoe\n'
+ print -r ${(q+)foo}
+0:Extended minimal quoting of quotes and backslashes
+>$'one\\two\n\'buckle\'\tmy\\shoe\n'



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