summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--string.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index e1fedc8fe1..7a03a3cd45 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat Jan 5 02:14:45 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * string.c (trnext): should enable backslash escape.
+
Sat Jan 5 01:50:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (Init_eval): move instance_eval and instance_exec to
diff --git a/string.c b/string.c
index 87f61a3321..6a491ddabd 100644
--- a/string.c
+++ b/string.c
@@ -3481,6 +3481,9 @@ trnext(struct tr *t, rb_encoding *enc)
for (;;) {
if (!t->gen) {
if (t->p == t->pend) return -1;
+ if (t->p < t->pend - 1 && *t->p == '\\') {
+ t->p++;
+ }
t->now = rb_enc_codepoint(t->p, t->pend, enc);
t->p += rb_enc_codelen(t->now, enc);
if (t->p < t->pend - 1 && *t->p == '-') {