aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2002-09-13 11:22:21 +0000
committerKenichi Handa2002-09-13 11:22:21 +0000
commitbc796a59e2634d2e62efb9fba7cae981b70b7847 (patch)
tree81bc62ec47b346c80f54291c2df0b59d447048be /src
parentb028bdcbc5c024afb2fadd2144a2b569c6202237 (diff)
downloademacs-bc796a59e2634d2e62efb9fba7cae981b70b7847.tar.gz
emacs-bc796a59e2634d2e62efb9fba7cae981b70b7847.zip
(skip_chars): Fix previous change.
(skip_syntaxes): Fix previous change.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/syntax.c39
2 files changed, 23 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c01ca49fa24..f72e6601ebf 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12002-09-13 Kenichi Handa <handa@etl.go.jp>
2
3 * syntax.c (skip_chars): Fix previous change.
4 (skip_syntaxes): Fix previous change.
5
12002-09-06 Dave Love <fx@gnu.org> 62002-09-06 Dave Love <fx@gnu.org>
2 7
3 * config.in: Restore it. 8 * config.in: Restore it.
diff --git a/src/syntax.c b/src/syntax.c
index f4b5270ee9f..debe8c8a9d8 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1420,6 +1420,9 @@ skip_chars (forwardp, string, lim)
1420 if (multibyte) 1420 if (multibyte)
1421 char_ranges = (int *) alloca (XSTRING (string)->size * (sizeof (int)) * 2); 1421 char_ranges = (int *) alloca (XSTRING (string)->size * (sizeof (int)) * 2);
1422 1422
1423 str = XSTRING (string)->data;
1424 size_byte = STRING_BYTES (XSTRING (string));
1425
1423 i_byte = 0; 1426 i_byte = 0;
1424 if (i_byte < size_byte 1427 if (i_byte < size_byte
1425 && XSTRING (string)->data[0] == '^') 1428 && XSTRING (string)->data[0] == '^')
@@ -1433,9 +1436,6 @@ skip_chars (forwardp, string, lim)
1433 If STRING contains non-ASCII characters, setup char_ranges for 1436 If STRING contains non-ASCII characters, setup char_ranges for
1434 them and use fastmap only for their leading codes. */ 1437 them and use fastmap only for their leading codes. */
1435 1438
1436 str = XSTRING (string)->data;
1437 size_byte = STRING_BYTES (XSTRING (string));
1438
1439 if (! string_multibyte) 1439 if (! string_multibyte)
1440 { 1440 {
1441 int string_has_eight_bit = 0; 1441 int string_has_eight_bit = 0;
@@ -1662,9 +1662,8 @@ skip_chars (forwardp, string, lim)
1662 } 1662 }
1663 else 1663 else
1664 { 1664 {
1665 while (pos < XINT (lim) && fastmap[FETCH_BYTE (pos)]) 1665 while (pos < XINT (lim) && fastmap[FETCH_BYTE (pos_byte)])
1666 pos++; 1666 pos++, pos_byte++;
1667 pos_byte = pos;
1668 } 1667 }
1669 } 1668 }
1670 else 1669 else
@@ -1693,9 +1692,8 @@ skip_chars (forwardp, string, lim)
1693 } 1692 }
1694 else 1693 else
1695 { 1694 {
1696 while (pos > XINT (lim) && fastmap[FETCH_BYTE (pos - 1)]) 1695 while (pos > XINT (lim) && fastmap[FETCH_BYTE (pos_byte - 1)])
1697 pos--; 1696 pos--, pos_byte--;
1698 pos_byte = pos;
1699 } 1697 }
1700 } 1698 }
1701 1699
@@ -1738,6 +1736,13 @@ skip_syntaxes (forwardp, string, lim)
1738 1736
1739 bzero (fastmap, sizeof fastmap); 1737 bzero (fastmap, sizeof fastmap);
1740 1738
1739 if (STRING_BYTES (XSTRING (string)) > XSTRING (string)->size)
1740 /* As this is very rare case, don't consider efficiency. */
1741 string = string_make_unibyte (string);
1742
1743 str = XSTRING (string)->data;
1744 size_byte = STRING_BYTES (XSTRING (string));
1745
1741 i_byte = 0; 1746 i_byte = 0;
1742 if (i_byte < size_byte 1747 if (i_byte < size_byte
1743 && XSTRING (string)->data[0] == '^') 1748 && XSTRING (string)->data[0] == '^')
@@ -1745,12 +1750,6 @@ skip_syntaxes (forwardp, string, lim)
1745 negate = 1; i_byte++; 1750 negate = 1; i_byte++;
1746 } 1751 }
1747 1752
1748 if (STRING_BYTES (XSTRING (string)) > XSTRING (string)->size)
1749 /* As this is very rare case, don't consider efficiency. */
1750 string = string_make_unibyte (string);
1751 str = XSTRING (string)->data;
1752 size_byte = STRING_BYTES (XSTRING (string));
1753
1754 /* Find the syntaxes specified and set their elements of fastmap. */ 1753 /* Find the syntaxes specified and set their elements of fastmap. */
1755 1754
1756 while (i_byte < size_byte) 1755 while (i_byte < size_byte)
@@ -1791,14 +1790,13 @@ skip_syntaxes (forwardp, string, lim)
1791 { 1790 {
1792 while (pos < XINT (lim)) 1791 while (pos < XINT (lim))
1793 { 1792 {
1794 c = FETCH_BYTE (pos); 1793 c = FETCH_BYTE (pos_byte);
1795 MAKE_CHAR_MULTIBYTE (c); 1794 MAKE_CHAR_MULTIBYTE (c);
1796 if (fastmap[(int) SYNTAX (c)]) 1795 if (fastmap[(int) SYNTAX (c)])
1797 break; 1796 break;
1798 pos++; 1797 pos++, pos_byte++;
1799 UPDATE_SYNTAX_TABLE_FORWARD (pos); 1798 UPDATE_SYNTAX_TABLE_FORWARD (pos);
1800 } 1799 }
1801 pos_byte = pos;
1802 } 1800 }
1803 } 1801 }
1804 else 1802 else
@@ -1826,16 +1824,15 @@ skip_syntaxes (forwardp, string, lim)
1826 if (pos > XINT (lim)) 1824 if (pos > XINT (lim))
1827 while (1) 1825 while (1)
1828 { 1826 {
1829 c = FETCH_BYTE (pos - 1); 1827 c = FETCH_BYTE (pos_byte - 1);
1830 MAKE_CHAR_MULTIBYTE (c); 1828 MAKE_CHAR_MULTIBYTE (c);
1831 if (! fastmap[(int) SYNTAX (c)]) 1829 if (! fastmap[(int) SYNTAX (c)])
1832 break; 1830 break;
1833 pos--; 1831 pos--, pos_byte--;
1834 if (pos <= XINT (lim)) 1832 if (pos <= XINT (lim))
1835 break; 1833 break;
1836 UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1); 1834 UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1);
1837 } 1835 }
1838 pos_byte = pos;
1839 } 1836 }
1840 } 1837 }
1841 1838