aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorKen Raeburn2002-07-19 14:27:24 +0000
committerKen Raeburn2002-07-19 14:27:24 +0000
commit2e567bd3ecb3e5bf61c7a6d349b8ff944390aca0 (patch)
treec6ab052ecff9acc6e89d9019b45223b9fafb1b8c /src/syntax.c
parentdca0fc1c6ce86193b6973dcd06f6e29893439357 (diff)
downloademacs-2e567bd3ecb3e5bf61c7a6d349b8ff944390aca0.tar.gz
emacs-2e567bd3ecb3e5bf61c7a6d349b8ff944390aca0.zip
(Fstring_to_syntax, skip_chars): Treat Lisp string
contents as const.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c9
1 files changed, 5 insertions, 4 deletions
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. */)
901 (string) 901 (string)
902 Lisp_Object string; 902 Lisp_Object string;
903{ 903{
904 register unsigned char *p; 904 register const unsigned char *p;
905 register enum syntaxcode code; 905 register enum syntaxcode code;
906 int val; 906 int val;
907 Lisp_Object match; 907 Lisp_Object match;
@@ -1365,7 +1365,7 @@ skip_chars (forwardp, syntaxp, string, lim)
1365 int multibyte = !NILP (current_buffer->enable_multibyte_characters); 1365 int multibyte = !NILP (current_buffer->enable_multibyte_characters);
1366 int string_multibyte; 1366 int string_multibyte;
1367 int size_byte; 1367 int size_byte;
1368 unsigned char *str; 1368 const unsigned char *str;
1369 int len; 1369 int len;
1370 1370
1371 CHECK_STRING (string); 1371 CHECK_STRING (string);
@@ -1386,10 +1386,11 @@ skip_chars (forwardp, syntaxp, string, lim)
1386 nbytes = SCHARS (string); 1386 nbytes = SCHARS (string);
1387 if (nbytes != size_byte) 1387 if (nbytes != size_byte)
1388 { 1388 {
1389 str = (unsigned char *) alloca (nbytes); 1389 unsigned char *tmp = (unsigned char *) alloca (nbytes);
1390 copy_text (SDATA (string), str, size_byte, 1390 copy_text (SDATA (string), tmp, size_byte,
1391 string_multibyte, multibyte); 1391 string_multibyte, multibyte);
1392 size_byte = nbytes; 1392 size_byte = nbytes;
1393 str = tmp;
1393 } 1394 }
1394 } 1395 }
1395 1396