summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-21 18:21:41 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-21 18:21:41 +0000
commitf23a113fcd8794c835163a1ff39dee59c4eb27c2 (patch)
treef631f6abb8a2093e512bb02686ee66fe13642105
parent6747cd5a35348553e9f68492c13fb33d43e35899 (diff)
downloadruby-f23a113fcd8794c835163a1ff39dee59c4eb27c2.tar.gz
ruby-f23a113fcd8794c835163a1ff39dee59c4eb27c2.tar.xz
ruby-f23a113fcd8794c835163a1ff39dee59c4eb27c2.zip
* re.c (rb_reg_prepare_re): stop ENCODING_NONE warning if the
encoding of the str is ASCII-8BIT. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog3
-rw-r--r--re.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ab2bf0928..4ccc57d29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@ Sat Dec 22 02:49:02 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (command): block from cmd_brace_block was ignored.
[ruby-dev:32644]
+ * re.c (rb_reg_prepare_re): stop ENCODING_NONE warning if the
+ encoding of the str is ASCII-8BIT.
+
Sat Dec 22 01:52:11 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (io_ungetc): avoid buffer relocation, which might cause
diff --git a/re.c b/re.c
index e6b2e50ac..e23a1b762 100644
--- a/re.c
+++ b/re.c
@@ -954,9 +954,10 @@ rb_reg_prepare_re(VALUE re, VALUE str)
need_recompile = 1;
}
if ((RBASIC(re)->flags & REG_ENCODING_NONE) &&
+ enc != rb_default_encoding() &&
rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
rb_warn("none encoding regexp with non ASCII string (string encoding: %s)",
- rb_enc_name(rb_enc_get(str)));
+ rb_enc_name(enc));
}
}