Bläddra i källkod

Fixed Sys.command with "," in file name. (see #5541)

Andy Li 9 år sedan
förälder
incheckning
494b409c09
3 ändrade filer med 16 tillägg och 1 borttagningar
  1. 1 1
      std/StringTools.hx
  2. 9 0
      tests/sys/src/FileNames.hx
  3. 6 0
      tests/sys/src/TestArguments.hx

+ 1 - 1
std/StringTools.hx

@@ -503,7 +503,7 @@ class StringTools {
 	/**
 		Character codes of the characters that will be escaped by `quoteWinArg(_, true)`.
 	*/
-	public static var winMetaCharacters = [" ".code, "(".code, ")".code, "%".code, "!".code, "^".code, "\"".code, "<".code, ">".code, "&".code, "|".code, "\n".code, "\r".code];
+	public static var winMetaCharacters = [" ".code, "(".code, ")".code, "%".code, "!".code, "^".code, "\"".code, "<".code, ">".code, "&".code, "|".code, "\n".code, "\r".code, ",".code, ";".code];
 
 	/**
 		Returns a String that can be used as a single command line argument

+ 9 - 0
tests/sys/src/FileNames.hx

@@ -8,6 +8,15 @@ class FileNames {
 		// a space inside
 		"two words",
 
+		// some valid seperators
+		"two-words",
+		"two_words",
+		"two,words",
+		"two.words",
+		"two;words",
+		"(two words)",
+		"[two words]",
+
 		// Chinese, Japanese
 		#if !(cs || python || php || neko || cpp || java)
 		"中文,にほんご",

+ 6 - 0
tests/sys/src/TestArguments.hx

@@ -14,10 +14,16 @@ class TestArguments extends haxe.unit.TestCase {
 		"|",
 		"||",
 		".",
+		",",
 		"<",
 		">",
 		"<<",
 		">>",
+		":",
+		";",
+		"(",
+		")",
+		"( )",
 
 		// backslashes
 		"\\",