Commit 7eebbce4 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #3437 from eboda/master

Fix interpolation escaping in String.inspect
parents 794de331 46e4e342
...@@ -2644,7 +2644,7 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str) ...@@ -2644,7 +2644,7 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str)
} }
#endif #endif
c = *p; c = *p;
if (c == '"'|| c == '\\' || (c == '#' && IS_EVSTR(p, pend))) { if (c == '"'|| c == '\\' || (c == '#' && IS_EVSTR(p+1, pend))) {
buf[0] = '\\'; buf[1] = c; buf[0] = '\\'; buf[1] = c;
mrb_str_cat(mrb, result, buf, 2); mrb_str_cat(mrb, result, buf, 2);
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment