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

Handle special characters in Shlex better #79

Closed
ascopes opened this issue Jan 29, 2024 · 0 comments · Fixed by #109
Closed

Handle special characters in Shlex better #79

ascopes opened this issue Jan 29, 2024 · 0 comments · Fixed by #109
Labels
bug Something isn't working

Comments

@ascopes
Copy link
Owner

ascopes commented Jan 29, 2024

I want to change how shell quoting is handled in src/main/**/platform/Shlex.java so that it can cope with parameters that have characters like \r and \n in them on the off-chance the user has some kind of really obscure path requirements somewhere.

If this happens, the argument needs to be changed to the format $'\\r' around those characters to ensure they are escaped properly.

For example

Given Expect
\r ''$'\\r'''
hello\nworld 'hello'$'\\n''world'

Note that \\r is a Java-escaped string, which would print literally as \r, whereas \r itself implies a carriage return character literal.

We also need to handle binary sequences I guess.

@ascopes ascopes added bug Something isn't working enhancement labels Jan 29, 2024
ascopes added a commit that referenced this issue Mar 7, 2024
- Handle \r \n and \t in shell scripts.
- Handle % in batch scripts.

Fixes GH-79.
ascopes added a commit that referenced this issue Mar 7, 2024
GH-79: Handle special characters in shell scripts better
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant