summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>1998-05-18 04:53:37 +0000
committerKenichi Handa <handa@m17n.org>1998-05-18 04:53:37 +0000
commit1e11d6512cf712eeca3db2e0bc80a42ffe2eaeb2 (patch)
tree25dcef05891b2549ad68c2b90b5ec15a1ba4f0ba
parent15e92a336d6b88540e90e3acaa79119a9c9f47fa (diff)
downloademacs-1e11d6512cf712eeca3db2e0bc80a42ffe2eaeb2.tar.gz
(skip_chars): Fix previous change.
-rw-r--r--src/syntax.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 9e15cc4ff43..d043e115565 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1254,6 +1254,7 @@ skip_chars (forwardp, syntaxp, string, lim)
register int i, i_byte;
int multibyte = !NILP (current_buffer->enable_multibyte_characters);
int string_multibyte = STRING_MULTIBYTE (string);
+ int size_byte = STRING_BYTES (XSTRING (string));
CHECK_STRING (string, 0);
char_ranges = (int *) alloca (XSTRING (string)->size * (sizeof (int)) * 2);
@@ -1273,7 +1274,7 @@ skip_chars (forwardp, syntaxp, string, lim)
i = 0, i_byte = 0;
- if (i < XSTRING (string)->size
+ if (i_byte < size_byte
&& XSTRING (string)->data[0] == '^')
{
negate = 1; i++, i_byte++;
@@ -1283,7 +1284,7 @@ skip_chars (forwardp, syntaxp, string, lim)
If syntaxp, each character counts as itself.
Otherwise, handle backslashes and ranges specially. */
- while (i < XSTRING (string)->size)
+ while (i_byte < size_byte)
{
int c_leading_code;
@@ -1293,7 +1294,7 @@ skip_chars (forwardp, syntaxp, string, lim)
FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
}
else
- c = c_leading_code = XSTRING (string)->data[i++];
+ c = c_leading_code = XSTRING (string)->data[i_byte++];
/* Convert multibyteness between what the string has
and what the buffer has. */
@@ -1308,18 +1309,18 @@ skip_chars (forwardp, syntaxp, string, lim)
{
if (c == '\\')
{
- if (i == XSTRING (string)->size)
+ if (i_byte == size_byte)
break;
if (string_multibyte)
{
- c_leading_code = XSTRING (string)->data[i];
+ c_leading_code = XSTRING (string)->data[i_byte];
FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
}
else
- c = c_leading_code = XSTRING (string)->data[i++];
+ c = c_leading_code = XSTRING (string)->data[i_byte++];
}
- if (i < XSTRING (string)->size
+ if (i_byte < size_byte
&& XSTRING (string)->data[i_byte] == '-')
{
unsigned int c2, c2_leading_code;
@@ -1327,7 +1328,7 @@ skip_chars (forwardp, syntaxp, string, lim)
/* Skip over the dash. */
i++, i_byte++;
- if (i == XSTRING (string)->size)
+ if (i_byte == size_byte)
break;
/* Get the end of the range. */
@@ -1337,7 +1338,7 @@ skip_chars (forwardp, syntaxp, string, lim)
FETCH_STRING_CHAR_ADVANCE (c2, string, i, i_byte);
}
else
- c2 = XSTRING (string)->data[i++];
+ c2 = XSTRING (string)->data[i_byte++];
if (SINGLE_BYTE_CHAR_P (c))
{