summaryrefslogtreecommitdiff
path: root/regparse.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-20 23:56:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-20 23:56:40 +0000
commit05a157ed8a0f0c149e7b66331209ef87fe6225a9 (patch)
tree08eacb4ed18f039f66e57e6e1f6890bdf6f0bde7 /regparse.c
parent5e7203ea220c44dea58eb96fe88517f0fb015ce5 (diff)
* regparse.c (parse_char_class): CCV_SB is only for single
byte. [ruby-dev:36786] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regparse.c')
-rw-r--r--regparse.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/regparse.c b/regparse.c
index 9ec441dab8..c7b42eaf74 100644
--- a/regparse.c
+++ b/regparse.c
@@ -4218,9 +4218,8 @@ parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end,
fetched = 0;
switch (r) {
case TK_CHAR:
- if (tok->u.code >= SINGLE_BYTE_SIZE) goto code_point;
- len = ONIGENC_CODE_TO_MBCLEN(env->enc, tok->u.c);
- if (len > 1) {
+ if ((tok->u.code >= SINGLE_BYTE_SIZE) ||
+ (len = ONIGENC_CODE_TO_MBCLEN(env->enc, tok->u.c)) > 1) {
in_type = CCV_CODE_POINT;
}
else if (len < 0) {
@@ -4292,7 +4291,6 @@ parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end,
break;
case TK_CODE_POINT:
- code_point:
v = tok->u.code;
in_israw = 1;
val_entry: