From 46e4e342f4a1bf216c027838e343919556703547 Mon Sep 17 00:00:00 2001 From: Edgar Boda-Majer Date: Tue, 7 Feb 2017 13:33:53 +0100 Subject: Fix interpolation escaping in String.inspect --- src/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/string.c') 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; -- cgit v1.2.3