Browse Source

Escape backslashes. (#10141)

Juraj Kirchheim 4 years ago
parent
commit
47ff2606f6
1 changed files with 2 additions and 1 deletions
  1. 2 1
      std/haxe/macro/Printer.hx

+ 2 - 1
std/haxe/macro/Printer.hx

@@ -81,7 +81,8 @@ class Printer {
 
 	function escapeString(s:String, delim:String) {
 		return delim
-			+ s.replace("\n", "\\n")
+			+ s.replace('\\', '\\\\')
+				.replace("\n", "\\n")
 				.replace("\t", "\\t")
 				.replace("\r", "\\r")
 				.replace("'", "\\'")