diff options
author | ksaito <ksaito@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-04-27 15:53:16 +0000 |
---|---|---|
committer | ksaito <ksaito@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-04-27 15:53:16 +0000 |
commit | f79e25aadf4d1908cf7e7ae5d7ddced7f91bb724 (patch) | |
tree | 9592a64a95b8b03df005c11a97016e4512d3706e /regcomp.c | |
parent | 487f5fa499ae5db04adf5bc8ed2671341c403f76 (diff) | |
download | ruby-f79e25aadf4d1908cf7e7ae5d7ddced7f91bb724.tar.gz ruby-f79e25aadf4d1908cf7e7ae5d7ddced7f91bb724.tar.xz ruby-f79e25aadf4d1908cf7e7ae5d7ddced7f91bb724.zip |
This commit was generated by cvs2svn to compensate for changes in r6225,
which included commits to RCS files with non-trunk default branches.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 29 |
1 files changed, 12 insertions, 17 deletions
@@ -3021,7 +3021,7 @@ setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env) NSTRING_SET_CASE_AMBIG(node); break; } - p++; + p += enc_len(reg->enc, *p); } } break; @@ -3950,22 +3950,17 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env) } } - if (IS_NULL(cc->mbuf)) { - if (cc->not) { - for (i = 0; i < SINGLE_BYTE_SIZE; i++) { - add_char_opt_map_info(&opt->map, i); - } - mb_found = 1; - } - } - else { - for (i = 0; i < SINGLE_BYTE_SIZE; i++) { - z = ONIGENC_IS_MBC_HEAD(env->enc, i); - if (z) { - mb_found = 1; - add_char_opt_map_info(&opt->map, i); - } - } + if (! ONIGENC_IS_SINGLEBYTE(env->enc)) { + if (! IS_NULL(cc->mbuf) || + (cc->not != 0 && found != 0)) { + for (i = 0; i < SINGLE_BYTE_SIZE; i++) { + z = ONIGENC_IS_MBC_HEAD(env->enc, i); + if (z) { + mb_found = 1; + add_char_opt_map_info(&opt->map, i); + } + } + } } if (mb_found) { |