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

syntax: Quote should probably return "" instead of empty for an empty string #763

Closed
andreynering opened this issue Nov 21, 2021 · 1 comment
Milestone

Comments

@andreynering
Copy link
Collaborator

Originally reported at go-task/task#609.

If you quote an empty string the returned value won't work in a concatenated Bash script: == 'foo' vs. the desired "" == "foo".

I think it'd make sense to fix this here, because more people could use the returned value inside Bash scripts. But if you don't think so, I gonna do this fix on the Task side.

@mvdan
Copy link
Owner

mvdan commented Nov 21, 2021

This actually got caught by the fuzzer after I improved it a little, and is already fixed on master; see 92eab20.

I'm preparing for a v3.4.1 release soon, but I actually forgot to cherry-pick that into https://github.com/mvdan/sh/tree/v3.4 - oops. Fixed now. I plan on doing the release in a few days; you can go get the HEAD of that branch in the meantime.

I'm going to close this for now, as the bug is already fixed. Thanks!

@mvdan mvdan closed this as completed Nov 21, 2021
@mvdan mvdan added this to the 3.4.1 milestone Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants