-
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
import {quote} from "shell-quote";
console.log(quote(['cat', '~/.bashrc'])); // tilde not quoted
console.log(quote(['cat', '~/s p a c e'])); // tilde quotedThe treatment of ~ should be consistent at the very least. I find it surprising that ~ is not quoted since all other special Bash characters are quoted.
I suggest adding ~ to the list of characters to quote in this line:
Line 14 in da8a3ab
| return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, '$1\\$2'); |
This quirk was showcased last week in a AmateursCTF challenge.
Metadata
Metadata
Assignees
Labels
No labels