This commit is contained in:
Dante
2026-05-21 23:40:20 -07:00
parent 3e2915dff7
commit 877a69d844
5737 changed files with 29796 additions and 1589684 deletions

View File

@ -45,12 +45,12 @@ class SysTools {
**/
public static function quoteWinArg(argument:String, escapeMetaCharacters:Bool):String {
// If there is no space, tab, back-slash, or double-quotes, and it is not an empty string.
if (!~/^[^ \t\\"]+$/.match(argument)) {
if (!~/^(\/)?[^ \t\/\\"]+$/.match(argument)) {
// Based on cpython's subprocess.list2cmdline().
// https://hg.python.org/cpython/file/50741316dd3a/Lib/subprocess.py#l620
var result = new StringBuf();
var needquote = argument.indexOf(" ") != -1 || argument.indexOf("\t") != -1 || argument == "";
var needquote = argument.indexOf(" ") != -1 || argument.indexOf("\t") != -1 || argument == "" || argument.indexOf("/") > 0;
if (needquote)
result.add('"');