summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-23 03:39:25 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-23 03:39:25 +0000
commitaffe49b23b9295ec30d50c363686324038d09158 (patch)
treecce0211c14874887245233ccde6a6ef10ae3d3f3 /regex.c
parentf4f0be3a12c4fdba190df790c55805142cf71d1b (diff)
* parse.y (arg): syntaxify tPOW negative number hack.
* parse.y (negate_lit): new function to negate literal numeric values in compile time. * regex.c (re_match_exec): charset info may be stored in MBC region when $KCODE != NONE. * error.c (set_syserr): should preserve duplicated error names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/regex.c b/regex.c
index 360b7a8..53eb9b4 100644
--- a/regex.c
+++ b/regex.c
@@ -740,7 +740,7 @@ is_in_list(c, b)
unsigned long c;
const unsigned char *b;
{
- return is_in_list_sbc(c, b) || is_in_list_mbc(c, b);
+ return is_in_list_sbc(c, b) || (current_mbctype ? is_in_list_mbc(c, b) : 0);
}
static void
@@ -1689,7 +1689,7 @@ re_compile_pattern(pattern, size, bufp)
SET_LIST_BIT(c);
had_num_literal = 0;
}
- else
+ else
set_list_bits(c, c, b);
had_mbchar = 0;
}
@@ -3838,16 +3838,16 @@ re_match_exec(bufp, string_arg, size, pos, beg, regs)
MBC2WC(c, d);
not = is_in_list_mbc(c, p);
if (!not) {
- part = not = is_in_list_sbc(cc, p);
+ part = not = is_in_list(cc, p);
}
} else {
- not = is_in_list_sbc(c, p);
+ not = is_in_list(c, p);
}
}
else {
if (TRANSLATE_P())
c = (unsigned char)translate[c];
- not = is_in_list_sbc(c, p);
+ not = is_in_list(c, p);
}
if (*(p - 1) == (unsigned char)charset_not) {