summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorEdgar Boda-Majer <[email protected]>2017-02-07 13:33:53 +0100
committerEdgar Boda-Majer <[email protected]>2017-02-07 13:33:53 +0100
commit46e4e342f4a1bf216c027838e343919556703547 (patch)
treee0996827c67b6689b825c18446eda4914f8887de /src
parent794de3317aa2f2adb9c84900e470f140e581092c (diff)
downloadmruby-46e4e342f4a1bf216c027838e343919556703547.tar.gz
mruby-46e4e342f4a1bf216c027838e343919556703547.zip
Fix interpolation escaping in String.inspect
Diffstat (limited to 'src')
-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;