summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-24 09:07:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-24 09:07:33 +0000
commit15ffbb1f820be7c798a7eb0aa2be11b5d4207460 (patch)
treef27d9d12e2cda0dca1435e1f0567d9fb423c7230 /re.c
parent9e214f30c4f2bb6e6529c1bb988be1e46026919f (diff)
* eval.c (rb_provide_feature): should not tweak extension used for
loading. * io.c (io_fread): use fread(3) if PENDING_COUND is available. * class.c (rb_mod_include_p): Module#include? added. [new] * re.c (ignorecase_setter): give warning on modifying $=. * string.c (rb_str_casecmp): new method. [new] * string.c (rb_str_eql): separated from rb_str_equal(), make it always be case sensitive. [new] * string.c (rb_str_hash): made it always be case sensitive. * eval.c (rb_f_require): should not include path in $" value * file.c (rb_find_file): should return 0 explicitly on failure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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);
}