From: Ken Raeburn Date: Fri, 19 Jul 2002 14:27:24 +0000 (+0000) Subject: (Fstring_to_syntax, skip_chars): Treat Lisp string X-Git-Tag: ttn-vms-21-2-B4~13971 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2e567bd3ecb3e5bf61c7a6d349b8ff944390aca0;p=emacs.git (Fstring_to_syntax, skip_chars): Treat Lisp string contents as const. --- diff --git a/src/syntax.c b/src/syntax.c index 8d6b052f14b..f020bdbbced 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -901,7 +901,7 @@ text property. */) (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 @@ skip_chars (forwardp, syntaxp, string, lim) 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 @@ skip_chars (forwardp, syntaxp, string, lim) 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; } }