Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"${#:+\e}" should evaluate to \e, not e #695

Closed
Crestwave opened this issue Apr 7, 2020 · 1 comment
Closed

"${#:+\e}" should evaluate to \e, not e #695

Crestwave opened this issue Apr 7, 2020 · 1 comment

Comments

@Crestwave
Copy link
Contributor

Crestwave commented Apr 7, 2020

Required for #679. I haven't checked any manuals, but I think that backslashes in quoted + parameter expansion should only be interpreted if preceding a special character.

$ echo "${#:+\$}"
$
$ echo "${#:+\e}"
\e
osh$ echo "${#:+\$}"
$
osh$ echo "${#:+\e}"
e
andychu pushed a commit that referenced this issue Apr 7, 2020
VSub_ArgDQ should have the same backslash behavior as DQ.

Reported by Crestwave on issue #695.
@andychu
Copy link
Contributor

andychu commented Apr 7, 2020

Fixed. Thanks, great catch! All shells appear to agree on this except yash: there are 4 special characters within double quotes: $ " backtick \.

andychu pushed a commit that referenced this issue Apr 7, 2020
- Fixes #698
- Fixes fallout from #695 (failing test in spec/var-sub-quote)

There is still a different failing test case to remind us to overhaul
this code.  And we still need to fix issue #291 too.

This area of the code needs a bunch of work.
andychu pushed a commit that referenced this issue Apr 15, 2020
Fixes issue #702.

This was a side effect of fixing #695 with commit 84c2r4.
@andychu andychu closed this as completed Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants