зеркало из https://github.com/github/ruby.git
* re.c (rb_reg_desc): Regexps of ASCII Compatible encoding may
contain non-ASCII characters. So in that case its encoding must keep original encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
48aad600ba
Коммит
00cdba732f
|
@ -1,3 +1,9 @@
|
|||
Sat Sep 20 07:59:31 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* re.c (rb_reg_desc): Regexps of ASCII Compatible encoding may
|
||||
contain non-ASCII characters. So in that case its encoding
|
||||
must keep original encoding.
|
||||
|
||||
Sat Sep 20 07:44:56 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* common.mk: prec.c is removed.
|
||||
|
|
8
re.c
8
re.c
|
@ -380,8 +380,12 @@ static VALUE
|
|||
rb_reg_desc(const char *s, long len, VALUE re)
|
||||
{
|
||||
VALUE str = rb_str_buf_new2("/");
|
||||
|
||||
rb_enc_associate(str, rb_usascii_encoding());
|
||||
if (rb_enc_asciicompat(rb_enc_get(re))) {
|
||||
rb_enc_copy(str, re);
|
||||
}
|
||||
else {
|
||||
rb_enc_associate(str, rb_usascii_encoding());
|
||||
}
|
||||
rb_reg_expr_str(str, s, len);
|
||||
rb_str_buf_cat2(str, "/");
|
||||
if (re) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче