From d08f28d839731cc4cc40181c88ee6db55b6975ee Mon Sep 17 00:00:00 2001 From: eban Date: Sun, 4 Mar 2001 09:46:08 +0000 Subject: [PATCH] * 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 --- ChangeLog | 6 +++++- string.c | 5 ++++- version.h | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5253b5b2d7..cb20d9bd57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Mar 4 17:01:09 2001 WATANABE Hirofumi + + * string.c (trnext): support backslash escape in String#tr. + Wed Feb 28 11:02:41 2001 Yukihiro Matsumoto * string.c (rb_str_delete_bang): delete! should take at least 1 @@ -201,7 +205,7 @@ Wed Feb 14 17:28:24 2001 Shugo Maeda Wed Feb 14 00:44:17 2001 Yukihiro Matsumoto - * dir.c (dir_s_glob): supprt backslash escape of metacharacters + * dir.c (dir_s_glob): support backslash escape of metacharacters and delimiters. * dir.c (remove_backslases): remove backslashes from path before diff --git a/string.c b/string.c index 374dc86867..5bdc6d9fdd 100644 --- a/string.c +++ b/string.c @@ -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) { diff --git a/version.h b/version.h index 2f70d977a9..4daab0b52c 100644 --- a/version.h +++ b/version.h @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.7.0" -#define RUBY_RELEASE_DATE "2001-02-28" +#define RUBY_RELEASE_DATE "2001-03-04" #define RUBY_VERSION_CODE 170 -#define RUBY_RELEASE_CODE 20010228 +#define RUBY_RELEASE_CODE 20010304