changeset 65475:92a8af59951a

(compose_chars_in_text): Fix setup of `pend'. Unconditionally reload `ptr' and `pend' after eval.
author Kim F. Storm <storm@cua.dk>
date Mon, 12 Sep 2005 20:38:47 +0000
parents dba2088fc82f
children 11058ae1650f
files src/composite.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/composite.c	Mon Sep 12 20:38:29 2005 +0000
+++ b/src/composite.c	Mon Sep 12 20:38:47 2005 +0000
@@ -616,7 +616,7 @@
       GCPRO1 (string);
       stop = end;
       ptr = SDATA (string) + string_char_to_byte (string, start);
-      pend = ptr + SBYTES (string);
+      pend = SDATA (string) + SBYTES (string);
     }
   else
     {
@@ -680,10 +680,19 @@
 		    {
 		      start += XINT (val);
 		      if (STRINGP (string))
-			ptr = SDATA (string) + string_char_to_byte (string, start);
+			{
+			  ptr = SDATA (string) + string_char_to_byte (string, start);
+			  pend = SDATA (string) + SBYTES (string);
+			}
 		      else
 			ptr = CHAR_POS_ADDR (start);
 		    }
+		  else if (STRINGP (string))
+		    {
+		      start++;
+		      ptr = SDATA (string) + string_char_to_byte (string, start);
+		      pend = SDATA (string) + SBYTES (string);
+		    }
 		  else
 		    {
 		      start++;