summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/re.c b/re.c
index bd8f34a..877ad4c 100644
--- a/re.c
+++ b/re.c
@@ -72,16 +72,12 @@ static const char casetable[] = {
#define MIN(a,b) (((a)>(b))?(b):(a))
int
-rb_memcmp(p1, p2, len)
+rb_memcicmp(p1, p2, len)
char *p1, *p2;
long len;
{
int tmp;
- if (!ruby_ignorecase) {
- return memcmp(p1, p2, len);
- }
-
while (len--) {
if (tmp = casetable[(unsigned)*p1++] - casetable[(unsigned)*p2++])
return tmp;
@@ -89,6 +85,19 @@ rb_memcmp(p1, p2, len)
return 0;
}
+int
+rb_memcmp(p1, p2, len)
+ char *p1, *p2;
+ long len;
+{
+ int tmp;
+
+ if (!ruby_ignorecase) {
+ return memcmp(p1, p2, len);
+ }
+ return rb_memcicmp(p1, p2, len);
+}
+
#define REG_CASESTATE FL_USER0
#define KCODE_NONE 0
#define KCODE_EUC FL_USER1
@@ -1304,9 +1313,11 @@ ignorecase_getter()
}
static void
-ignorecase_setter(val)
+ignorecase_setter(val, id)
VALUE val;
+ ID id;
{
+ rb_warn("modifying %s is deperecated", rb_id2name(id));
may_need_recompile = 1;
ruby_ignorecase = RTEST(val);
}