single_quote patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux