changeset 46555:35e66a0949b8

(Fstring_to_syntax, skip_chars): Treat Lisp string contents as const.
author Ken Raeburn <raeburn@raeburn.org>
date Fri, 19 Jul 2002 14:27:24 +0000
parents fb13fafbd279
children 71e205b50a3e
files src/syntax.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/syntax.c	Fri Jul 19 14:27:20 2002 +0000
+++ b/src/syntax.c	Fri Jul 19 14:27:24 2002 +0000
@@ -901,7 +901,7 @@
      (string)
      Lisp_Object string;
 {
-  register unsigned char *p;
+  register const unsigned char *p;
   register enum syntaxcode code;
   int val;
   Lisp_Object match;
@@ -1365,7 +1365,7 @@
   int multibyte = !NILP (current_buffer->enable_multibyte_characters);
   int string_multibyte;
   int size_byte;
-  unsigned char *str;
+  const unsigned char *str;
   int len;
 
   CHECK_STRING (string);
@@ -1386,10 +1386,11 @@
 	nbytes = SCHARS (string);
       if (nbytes != size_byte)
 	{
-	  str = (unsigned char *) alloca (nbytes);
-	  copy_text (SDATA (string), str, size_byte,
+	  unsigned char *tmp = (unsigned char *) alloca (nbytes);
+	  copy_text (SDATA (string), tmp, size_byte,
 		     string_multibyte, multibyte);
 	  size_byte = nbytes;
+	  str = tmp;
 	}
     }