summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorksaito <ksaito@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-27 15:53:16 +0000
committerksaito <ksaito@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-27 15:53:16 +0000
commit653fbad62809d98e01a9bf70e7c6f69fbbc5b524 (patch)
tree9592a64a95b8b03df005c11a97016e4512d3706e /regcomp.c
parent315b3e19061212fa96e98d291ad7f2b5fc090446 (diff)
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@6226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/regcomp.c b/regcomp.c
index 24d44dd1b8..de44cfe037 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -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) {