Filenames with a complete set of parentheses are not expanded properly
Created by: huntergoldstein
Reproduction: Create a filename such as foo()
and attempt to refer to it using escaped parentheses.
Expected behavior: The following completes with no output, implying no error has occurred.
$ touch "foo()"
$ cat foo\(\)
Actual behavior:
$ touch "foo()"
$ cat foo\(\)
cat: 'foo(\)': No such file or directory
Build information:
rustc -V => rustc 1.19.0-nightly (14f30da61 2017-05-21)
get rev-parse HEAD => 3352a0cb8c67da3aff135ad7849b366d35bcd407
Blocking/related:
- I came across this issue while confirming that #284 (closed) works as expected
- #4 (closed) covers this, but it is still open
Misc:
- I'm guessing (based on some minimal prodding) the issue has to do with the behavior of
WordIterator
insideparser::shell_expand::expand_string
. The contents oftoken_buffer
at this point ends up being:[Normal("foo"), Normal("(\\)")]
where it should be[Normal("foo"), Normal("("), Normal(")")]
- Confirmed above, submitting PR for review shortly