changeset 29018:2f43c508a9b5

(wordify): Use FETCH_STRING_CHAR_ADVANCE unconditionally. (Freplace_match): Use FETCH_STRING_CHAR_ADVANCE and FETCH_STRING_CHAR_ADVANCE_NO_CHECK appropriately.
author Kenichi Handa <handa@m17n.org>
date Sat, 20 May 2000 00:05:02 +0000
parents 8f10362eb5ff
children 50e144ba4af7
files src/search.c
diffstat 1 files changed, 6 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c	Sat May 20 00:04:37 2000 +0000
+++ b/src/search.c	Sat May 20 00:05:02 2000 +0000
@@ -1959,10 +1959,7 @@
     {
       int c;
       
-      if (STRING_MULTIBYTE (string))
-	FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
-      else
-	c = XSTRING (string)->data[i++];
+      FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
 
       if (SYNTAX (c) != Sword)
 	{
@@ -1997,13 +1994,7 @@
       int c;
       int i_byte_orig = i_byte;
       
-      if (STRING_MULTIBYTE (string))
-	FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
-      else
-	{
-	  c = XSTRING (string)->data[i++];
-	  i_byte++;
-	}
+      FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
 
       if (SYNTAX (c) == Sword)
 	{
@@ -2349,6 +2340,7 @@
 	      if (c == '\\')
 		{
 		  FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte);
+		      
 		  if (c == '&')
 		    {
 		      substart = search_regs.start[sub];
@@ -2460,7 +2452,7 @@
 
 	  if (str_multibyte)
 	    {
-	      FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte);
+	      FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext, pos, pos_byte);
 	      if (!buf_multibyte)
 		c = multibyte_char_to_unibyte (c, rev_tbl);
 	    }
@@ -2480,7 +2472,8 @@
 	    {
 	      if (str_multibyte)
 		{
-		  FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte);
+		  FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext,
+						      pos, pos_byte);
 		  if (!buf_multibyte && !SINGLE_BYTE_CHAR_P (c))
 		    c = multibyte_char_to_unibyte (c, rev_tbl);
 		}