changeset 18614:a9bf61beded5

(TRANSLATE, re_search_2, re_match_2_internal,bcmp_translate): Use RE_TRANSLATE instead of accessing translate array directly.
author Richard M. Stallman <rms@gnu.org>
date Fri, 04 Jul 1997 20:46:22 +0000
parents 614b916ff5bf
children 083eba7e6a53
files src/regex.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/regex.c	Fri Jul 04 20:44:52 1997 +0000
+++ b/src/regex.c	Fri Jul 04 20:46:22 1997 +0000
@@ -1540,7 +1540,7 @@
    when we use a character as a subscript we must make it unsigned.  */
 #ifndef TRANSLATE
 #define TRANSLATE(d) \
-  (translate ? (unsigned char) translate[(unsigned char) (d)] : (d))
+  (translate ? (unsigned char) RE_TRANSLATE (translate, (unsigned char) (d)) : (d))
 #endif
 
 
@@ -3810,7 +3810,7 @@
 	      if (translate)
 		while (range > lim
 		       && !fastmap[(unsigned char)
-				   translate[(unsigned char) *d++]])
+				   RE_TRANSLATE (translate, (unsigned char) *d++)])
 		  range--;
 	      else
 		while (range > lim && !fastmap[(unsigned char) *d++])
@@ -4500,7 +4500,7 @@
 	      do
 		{
 		  PREFETCH ();
-		  if ((unsigned char) translate[(unsigned char) *d++]
+		  if ((unsigned char) RE_TRANSLATE (translate, (unsigned char) *d++)
 		      != (unsigned char) *p++)
 		    goto fail;
 		}
@@ -5895,7 +5895,8 @@
   register unsigned char *p1 = s1, *p2 = s2;
   while (len)
     {
-      if (translate[*p1++] != translate[*p2++]) return 1;
+      if (RE_TRANSLATE (translate, *p1++) != RE_TRANSLATE (translate, *p2++))
+	return 1;
       len--;
     }
   return 0;