summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-03-04 09:46:08 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-03-04 09:46:08 +0000
commitd08f28d839731cc4cc40181c88ee6db55b6975ee (patch)
treefcd915e9a7f8a83b44d7ff75695afa16457b5ada
parentb3902727d538d5a55cfbda245399f3e951dbc5aa (diff)
* 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
-rw-r--r--ChangeLog6
-rw-r--r--string.c5
-rw-r--r--version.h4
3 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5253b5b..cb20d9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Mar 4 17:01:09 2001 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * string.c (trnext): support backslash escape in String#tr.
+
Wed Feb 28 11:02:41 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* 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 <shugo@ruby-lang.org>
Wed Feb 14 00:44:17 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
- * 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 374dc86..5bdc6d9 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 2f70d97..4daab0b 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