summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2003-01-16 01:44:22 +0000
committerKenichi Handa <handa@m17n.org>2003-01-16 01:44:22 +0000
commit468b61793ad8d1d92a3e0b13ed42624754d69cd8 (patch)
tree20145c44050c57a4e9fada7b36931a06e7908e87
parentc8498b2ce2bc7289574ee2f1c07c0f71ccd1ff08 (diff)
downloadgnulib-EMACS_21_1_RC.tar.gz
gnulib-EMACS_21_1_RC.tar.bz2
(GET_CHAR_BEFORE_2): Fix for the case that the previousEMACS_21_3EMACS_21_1_RC
char is eight-bit-graphic. (re_search_2): Likewise.
-rw-r--r--regex.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/regex.c b/regex.c
index 15ce02a142..f9ea4a558d 100644
--- a/regex.c
+++ b/regex.c
@@ -156,8 +156,12 @@
{ \
re_char *dtemp = (p) == (str2) ? (end1) : (p); \
re_char *dlimit = ((p) > (str2) && (p) <= (end2)) ? (str2) : (str1); \
+ re_char *d0 = dtemp; \
while (dtemp-- > dlimit && !CHAR_HEAD_P (*dtemp)); \
- c = STRING_CHAR (dtemp, (p) - dtemp); \
+ if (MULTIBYTE_FORM_LENGTH (dtemp, d0 - dtemp) == d0 - dtemp) \
+ c = STRING_CHAR (dtemp, d0 - dtemp); \
+ else \
+ c = d0[-1]; \
} \
else \
(c = ((p) == (str2) ? (end1) : (p))[-1]); \
@@ -4046,18 +4050,16 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
p--, len++;
/* Adjust it. */
-#if 0 /* XXX */
if (MULTIBYTE_FORM_LENGTH (p, len + 1) != (len + 1))
- ;
- else
-#endif
- {
- range += len;
- if (range > 0)
- break;
+ /* The previous character is eight-bit-graphic which
+ is represented by one byte even in a multibyte
+ buffer/string. */
+ len = 0;
+ range += len;
+ if (range > 0)
+ break;
- startpos -= len;
- }
+ startpos -= len;
}
}
}

Return to:

Send suggestions and report system problems to the System administrator.