changeset 30752:db737e34fc36

(regex_compile) <normal_char>: Pay attention to multibyteness. (analyse_first) <exactn>: Setup fastmap correctly for eight-bit-control characters.
author Kenichi Handa <handa@m17n.org>
date Fri, 11 Aug 2000 01:56:59 +0000
parents c10a26933929
children bc668ba63d2a
files src/regex.c
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/regex.c	Fri Aug 11 01:55:36 2000 +0000
+++ b/src/regex.c	Fri Aug 11 01:56:59 2000 +0000
@@ -3064,7 +3064,12 @@
 
 	  GET_BUFFER_SPACE (MAX_MULTIBYTE_LENGTH);
 	  {
-	    int len = CHAR_STRING (c, b);
+	    int len;
+
+	    if (multibyte)
+	      len = CHAR_STRING (c, b);
+	    else
+	      *b = c, len = 1;
 	    b += len;
 	    (*pending_exact) += len;
 	  }
@@ -3375,7 +3380,15 @@
 	 with `break'.	*/
 
 	case exactn:
-	  if (fastmap) fastmap[p[1]] = 1;
+	  if (fastmap)
+	    {
+	      int c = RE_STRING_CHAR (p + 1, pend - p);
+
+	      if (SINGLE_BYTE_CHAR_P (c))
+		fastmap[c] = 1;
+	      else
+		fastmap[p[1]] = 1;
+	    }
 	  break;