summaryrefslogtreecommitdiff
path: root/ext/json/lib/json/pure/parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/lib/json/pure/parser.rb')
-rw-r--r--ext/json/lib/json/pure/parser.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/json/lib/json/pure/parser.rb b/ext/json/lib/json/pure/parser.rb
index e886ba8d2c2..39bee542690 100644
--- a/ext/json/lib/json/pure/parser.rb
+++ b/ext/json/lib/json/pure/parser.rb
@@ -122,7 +122,8 @@ module JSON
def parse_string
if scan(STRING)
return '' if self[1].empty?
- self[1].gsub(%r((?:\\[\\bfnrt"/]|(?:\\u(?:[A-Fa-f\d]{4}))+|\\[\x20-\xff]))n) do |c|
+ self[1].gsub(%r((?:\\[\\bfnrt"/]|(?:\\u(?:[A-Fa-f\d]{4}))+|\\[\x20-\xff]))n) do
+ c = $&
if u = UNESCAPE_MAP[c[1]]
u
else # \uXXXX