diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-03-04 09:46:08 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-03-04 09:46:08 +0000 |
commit | d08f28d839731cc4cc40181c88ee6db55b6975ee (patch) | |
tree | fcd915e9a7f8a83b44d7ff75695afa16457b5ada /string.c | |
parent | b3902727d538d5a55cfbda245399f3e951dbc5aa (diff) | |
download | ruby-d08f28d839731cc4cc40181c88ee6db55b6975ee.tar.gz |
* string.c (trnext): support backslash escape in String#tr.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1801,7 +1801,10 @@ trnext(t) if (!t->gen) { if (t->p == t->pend) return -1; t->now = *(USTR)t->p++; - if (t->p < t->pend - 1 && *t->p == '-') { + if (t->p < t->pend - 1 && *t->p == '\\') { + t->p++; + } + else if (t->p < t->pend - 1 && *t->p == '-') { t->p++; if (t->p < t->pend) { if (t->now > *(USTR)t->p) { |