summaryrefslogtreecommitdiff
path: root/posix/regex_internal.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-07-27 08:20:17 +0000
committerUlrich Drepper <drepper@redhat.com>2002-07-27 08:20:17 +0000
commitac3d553b8b5bcfbc7a13bd746966036422cf5275 (patch)
treebbec8a946e4ecb0f3e36fadc722aa00d8e000d1c /posix/regex_internal.h
parent85ae1f3949469ce2bb01a3f55708b83d09e84ec8 (diff)
Update.
2002-07-27 Ulrich Drepper <drepper@redhat.com> * iconvdata/Makefile (CPPFLAGS): Add NOT_IN_libc. * iconv/iconv_prog.c (main): Improve error message for the cases where -t and/or -f parameter are missing. 2002-07-10 Stepan Kasal <kasal@math.cas.cz> * posix/regexec.c (re_match): Reorganize to remove duplicate code. (re_search): Likewise. (re_match_2): Likewise. (re_search_2): Likewise. (re_search_stub): New function. (re_search_2_stub): New function. * regcomp.c (re_compile_pattern): Typo in a comment fixed. 2002-07-10 Isamu Hasegawa <isamu@yamato.ibm.com> * posix/regex_internal.h: Add new member STOP to struct re_string_t. (re_string_eoi): Use STOP instead of LEN. * posix/regex_internal.c (re_string_allocate): Initialize pstr->len. (re_string_construct): Likewise. (re_string_reconstruct): Adjust pstr->stop like pstr->len. * posix/regexec.c (re_search_internal): Add a new argument STOP so that it can handle the argument STOP of re_search_2 and re_match_2 correctly. (regexec): Adapt to new I/F of re_search_internal. (re_search_stub): Likewise.
Diffstat (limited to 'posix/regex_internal.h')
-rw-r--r--posix/regex_internal.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/posix/regex_internal.h b/posix/regex_internal.h
index 20622540e8..a7f6042935 100644
--- a/posix/regex_internal.h
+++ b/posix/regex_internal.h
@@ -253,6 +253,11 @@ struct re_string_t
int cur_idx;
/* This is length_of_RAW_MBS - RAW_MBS_IDX. */
int len;
+ /* End of the buffer may be shorter than its length in the cases such
+ as re_match_2, re_search_2. Then, we use STOP for end of the buffer
+ instead of LEN. */
+ int stop;
+
/* The context of mbs[0]. We store the context independently, since
the context of mbs[0] may be different from raw_mbs[0], which is
the beginning of the input string. */
@@ -308,7 +313,7 @@ static unsigned int re_string_context_at (const re_string_t *input, int idx,
#define re_string_is_single_byte_char(pstr, idx) \
((pstr)->wcs[idx] != WEOF && ((pstr)->len == (idx) \
|| (pstr)->wcs[(idx) + 1] != WEOF))
-#define re_string_eoi(pstr) ((pstr)->len == (pstr)->cur_idx)
+#define re_string_eoi(pstr) ((pstr)->stop <= (pstr)->cur_idx)
#define re_string_cur_idx(pstr) ((pstr)->cur_idx)
#define re_string_get_buffer(pstr) ((pstr)->mbs)
#define re_string_length(pstr) ((pstr)->len)