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

Empty argument not quoted correctly #18

Closed
avdv opened this issue Nov 27, 2024 · 1 comment
Closed

Empty argument not quoted correctly #18

avdv opened this issue Nov 27, 2024 · 1 comment

Comments

@avdv
Copy link

avdv commented Nov 27, 2024

> var quote = require('shell-quote/quote');
> quote([ 'x', '', 'x' ]);
'x  x'

ie. passing in 3 arguments, we only get 2 out as the empty arg does not get any treatment.

The correct output would be x '' x.

@ljharb
Copy link
Owner

ljharb commented Nov 27, 2024

Indeed, given that parse('-x "" y') is [ '-x', '', 'y' ], it seems like a clear bug that quote([ '-x', '', 'y' ]) is not [ '-x', '', 'y' ].

@ljharb ljharb closed this as completed in 59d29ea Nov 27, 2024
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