Don't count successive "," as literal in brace expansion

This was highly surprising.

Fixes #3002.
This commit is contained in:
Fabian Homborg
2018-01-02 15:24:48 +01:00
parent 55ebf4430f
commit aa58cae601
5 changed files with 19 additions and 3 deletions

View File

@@ -15,11 +15,15 @@ logmsg Bracket expansion
echo x-{1}
echo x-{1,2}
echo foo-{1,2{3,4}}
echo foo-{} # literal "{}" expands to itself
echo foo-{{},{}} # the inner "{}" expand to themselves, the outer pair expands normally.
echo foo-{""} # still expands to foo-
echo foo-{$undefinedvar} # still expands to nothing
echo foo-{,,,} # four empty items in the braces.
echo foo-{,\,,} # an empty item, a "," and an empty item.
logmsg Escaped newlines
echo foo\ bar
echo foo\