summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
authorYukihiro Matsumoto <matz@ruby-lang.org>1995-02-24 13:15:43 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-17 22:09:31 +0900
commit881c5a9c320c637ee0f6526b40cf70c1379ab656 (patch)
tree3c0327fc9bdef8f056563ceee400226ac572535b /regex.c
parent2f106ab85c4f4e171374aee261f5a12bdd923c41 (diff)
version 0.68v0_68
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-0.67-0.68.diff.gz Fri Feb 24 13:15:43 1995 Yukihiro Matsumoto (matz@ix-02) * version 0.68 Thu Feb 23 11:19:19 1995 Yukihiro Matsumoto (matz@ix-02) * eval.c: resque節のselfの値が間違っていた. * eval.c(rb_clear_cache): キャッシュのクリアし忘れがあった. * eval.c: 定数のスコープをクラス内の静的スコープに変更した.これに よって,特異メソッドからは参照される定数は,レシーバのクラスでは なく,定義されたスコープのクラスの定数となる. Wed Feb 22 00:51:38 1995 Yukihiro Matsumoto (matz@dyna) * regex.c: ignorecaseを正規表現のコンパイル前に指定しないと正しく 動作しない.修正. * string.c(toupper,tolower): bug fix. * ENV,VERSION: readonly変数から定数へ.
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/regex.c b/regex.c
index e23d33eb11..bfd604f99c 100644
--- a/regex.c
+++ b/regex.c
@@ -1633,12 +1633,12 @@ re_compile_fastmap (bufp)
#endif
{
case exactn:
-#if 0 /* The original was: */
+#if 1 /* The original was: */
if (translate)
fastmap[translate[p[1]]] = 1;
else
fastmap[p[1]] = 1;
-#else /* The compiled pattern has already been translated. */
+#else /* The compiled pattern has already been translated. (not true for ruby) */
fastmap[p[1]] = 1;
#endif
break;
@@ -1775,7 +1775,7 @@ re_compile_fastmap (bufp)
for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
{
-#if 0 /* The original was: */
+#if 1 /* The original was: */
if (translate)
fastmap[translate[j]] = 1;
else
@@ -2911,7 +2911,9 @@ re_match_2 (pbufp, string1_arg, size1, string2_arg, size2, pos, regs, mstop)
goto fail;
continue;
}
- if ((unsigned char) translate[c] != (unsigned char) *p++)
+ /* compiled code translation needed for ruby */
+ if ((unsigned char) translate[c]
+ != (unsigned char) translate[*p++])
goto fail;
}
while (--mcnt);