* single_quote patch
@ 2021-01-29 18:56 Vladimir N. Oleynik
0 siblings, 0 replies; only message in thread
From: Vladimir N. Oleynik @ 2021-01-29 18:56 UTC (permalink / raw)
To: dash
Hello.
I rewrote (next version vs send to Herbert) single_quote()
for do not confusing in debug mode, more funny
showvars and showalias and allow the printf "%q" directive.
Before patch
$ ./dash-0.5.11.3 -x
$ foo () { local a=" b"; ls "$1"; [ -z "$1" ]; }
$ c=" x" foo
+ c= x foo
+ local a= b
+ ls
ls: cannot access '': No such file or directory
+ [ -z ]
After patch
$ ./dash-0.5.11.3.my -x
$ foo () { local a=" b"; ls "$1"; [ -z "$1" ]; }
$ c=" x" foo
+ c=' x' foo
+ local a=' b'
+ ls ''
ls: cannot access '': No such file or directory
+ '[' -z '' ']'
Before patch
:
$ a= b="a'b" c=a/b
+ a= b=a'b c=a/b
$ set +x; set | grep '^[abc]='
a=''
b='a'"'"'b'
c='a/b'
$ printf "%q\n" "a'b"
dash: 32: printf: %q: invalid directive
After patch
$ a= b="a'b" c=a/b
+ a= b="a'b" c=a/b
$ set +x; set | grep '^[abc]='
a=
b="a'b"
c=a/b
$ printf "%q\n" "a.b" "a'b"
a.b
"a'b"
The patch placed: ftp://simtreas.ru/pub/my/dash/single_quote_diff.txt.gz
(I can not send this patch to maillist - message dropped)
--w
vodz
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-29 18:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29 18:56 single_quote patch Vladimir N. Oleynik
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).