mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (reg_fragment_setenc_gen): recognize regexp with option n as
as ASCII-8BIT instead of US-ASCII. [ruby-dev:33339] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9b43eaf115
commit
e36dd52291
2 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Jan 24 16:24:25 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* parse.y (reg_fragment_setenc_gen): recognize regexp with option n as
|
||||
as ASCII-8BIT instead of US-ASCII. [ruby-dev:33339]
|
||||
|
||||
Thu Jan 24 15:44:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* array.c (collect_bang_i): use rb_ary_store() to avoid potential
|
||||
|
|
4
parse.y
4
parse.y
|
@ -456,6 +456,7 @@ static int lvar_defined_gen(struct parser_params*, ID);
|
|||
#define RE_OPTION_ENCODING_SHIFT 8
|
||||
#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
|
||||
#define RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
|
||||
#define RE_OPTION_ENCODING_NONE(o) ((o)&32)
|
||||
#define RE_OPTION_MASK 0xff
|
||||
|
||||
#define NODE_STRTERM NODE_ZARRAY /* nothing to gc */
|
||||
|
@ -8478,6 +8479,9 @@ reg_fragment_setenc_gen(struct parser_params* parser, VALUE str, int options)
|
|||
}
|
||||
ENCODING_SET(str, idx);
|
||||
}
|
||||
else if (RE_OPTION_ENCODING_NONE(options)) {
|
||||
rb_enc_associate(str, rb_ascii8bit_encoding());
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Reference in a new issue