Skip to content

Commit

Permalink
yorick: Fix unescaping of "\\n"
Browse files Browse the repository at this point in the history
  • Loading branch information
dubek committed Sep 25, 2017
1 parent c81a869 commit 33f404a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions yorick/reader.i
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ NUMBER_REGEXP = regcomp("^-?[0-9]+$")

func unescape(s)
{
s1 = strpart(s, 2:-1) // remove surrounding quotes
s2 = streplaceall(s1, "\\n", "\n")
s3 = streplaceall(s2, "\\\"", "\"")
return streplaceall(s3, "\\\\", "\\")
s = strpart(s, 2:-1) // remove surrounding quotes
s = streplaceall(s, "\\\\", "\x01")
s = streplaceall(s, "\\n", "\n")
s = streplaceall(s, "\\\"", "\"")
return streplaceall(s, "\x01", "\\")
}

func read_atom(rdr)
Expand Down

0 comments on commit 33f404a

Please sign in to comment.