Properly fix line break in strings.

This commit is contained in:
José Valim
2011-06-25 11:09:17 -03:00
parent a982ed9ad6
commit 4fed302df0
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -169,7 +169,7 @@ module String
def inspect
list = Erlang.binary_to_list(self)
if Erlang.io_lib.printable_unicode_list(list)
<<$\", gsub(~r{("|#|\n|\r)}, "\\\\\\1")|binary, $\">>
<<$\", gsub(~r{("|#)}, "\\\\\\1").gsub(~r{\n}, "\\\\n")|binary, $\">>
else
Erlang.io_lib.format($"~w", [self]).to_bin
end