aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorKenichi Handa2003-11-15 00:59:37 +0000
committerKenichi Handa2003-11-15 00:59:37 +0000
commitf003ca54d582625aecbef72afc416f8684e2a26b (patch)
tree247d81af5a4503494486bcb0d000409b9bb46693 /src/syntax.c
parentd8dadc3154b387dee9fbe8d97a31d1341be2c707 (diff)
downloademacs-f003ca54d582625aecbef72afc416f8684e2a26b.tar.gz
emacs-f003ca54d582625aecbef72afc416f8684e2a26b.zip
(skip_chars): Be sure to alloca char_ranges when necessary.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 5b25371fcbc..57c7e4d69f2 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1418,8 +1418,6 @@ skip_chars (forwardp, string, lim)
1418 string_multibyte = SBYTES (string) > SCHARS (string); 1418 string_multibyte = SBYTES (string) > SCHARS (string);
1419 1419
1420 bzero (fastmap, sizeof fastmap); 1420 bzero (fastmap, sizeof fastmap);
1421 if (multibyte)
1422 char_ranges = (int *) alloca (SCHARS (string) * (sizeof (int)) * 2);
1423 1421
1424 str = SDATA (string); 1422 str = SDATA (string);
1425 size_byte = SBYTES (string); 1423 size_byte = SBYTES (string);
@@ -1502,6 +1500,7 @@ skip_chars (forwardp, string, lim)
1502 fastmap[CHAR_LEADING_CODE (c)] = 1; 1500 fastmap[CHAR_LEADING_CODE (c)] = 1;
1503 range_start_byte = i; 1501 range_start_byte = i;
1504 range_start_char = c; 1502 range_start_char = c;
1503 char_ranges = (int *) alloca (sizeof (int) * 128 * 2);
1505 for (i = 129; i < 0400; i++) 1504 for (i = 129; i < 0400; i++)
1506 { 1505 {
1507 c = unibyte_char_to_multibyte (i); 1506 c = unibyte_char_to_multibyte (i);
@@ -1520,8 +1519,10 @@ skip_chars (forwardp, string, lim)
1520 + range_start_char); 1519 + range_start_char);
1521 } 1520 }
1522 } 1521 }
1523 else 1522 else /* STRING is multibyte */
1524 { 1523 {
1524 char_ranges = (int *) alloca (sizeof (int) * SCHARS (string) * 2);
1525
1525 while (i_byte < size_byte) 1526 while (i_byte < size_byte)
1526 { 1527 {
1527 unsigned char leading_code; 1528 unsigned char leading_code;
@@ -1564,6 +1565,8 @@ skip_chars (forwardp, string, lim)
1564 i_byte += len; 1565 i_byte += len;
1565 } 1566 }
1566 1567
1568 if (c > c2)
1569 continue;
1567 if (ASCII_CHAR_P (c)) 1570 if (ASCII_CHAR_P (c))
1568 { 1571 {
1569 while (c <= c2 && c < 0x80) 1572 while (c <= c2 && c < 0x80)