From b36c642a8571399bb2f38a5381e922d25ef07093 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 21 Dec 2007 18:21:41 +0000 Subject: [PATCH] * re.c (rb_reg_prepare_re): stop ENCODING_NONE warning if the encoding of the str is ASCII-8BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 3 +++ re.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ab2bf09285..4ccc57d296 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ Sat Dec 22 02:49:02 2007 Yukihiro Matsumoto * 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 * io.c (io_ungetc): avoid buffer relocation, which might cause diff --git a/re.c b/re.c index e6b2e50ac6..e23a1b7622 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)); } }