summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-02-08 08:58:41 +0900
committerGitHub <[email protected]>2017-02-08 08:58:41 +0900
commit7eebbce42ff62dc8e799d969194c9db5cc636a82 (patch)
treee0996827c67b6689b825c18446eda4914f8887de
parent794de3317aa2f2adb9c84900e470f140e581092c (diff)
parent46e4e342f4a1bf216c027838e343919556703547 (diff)
downloadmruby-7eebbce42ff62dc8e799d969194c9db5cc636a82.tar.gz
mruby-7eebbce42ff62dc8e799d969194c9db5cc636a82.zip
Merge pull request #3437 from eboda/master
Fix interpolation escaping in String.inspect
-rw-r--r--src/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index 7a75bb63e..c370e0723 100644
--- a/src/string.c
+++ b/src/string.c
@@ -2644,7 +2644,7 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str)
}
#endif
c = *p;
- if (c == '"'|| c == '\\' || (c == '#' && IS_EVSTR(p, pend))) {
+ if (c == '"'|| c == '\\' || (c == '#' && IS_EVSTR(p+1, pend))) {
buf[0] = '\\'; buf[1] = c;
mrb_str_cat(mrb, result, buf, 2);
continue;