aboutsummaryrefslogtreecommitdiffstats
path: root/src/regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex.c')
-rw-r--r--src/regex.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/regex.c b/src/regex.c
index a57ae00d14..a145183510 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -975,9 +975,10 @@ print_partial_compiled_pattern (start, end)
int has_range_table = CHARSET_RANGE_TABLE_EXISTS_P (p - 1);
fprintf (stderr, "/charset [%s",
- (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
+ (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
- assert (p + *p < pend);
+ if (p + *p >= pend)
+ fprintf (stderr, " !extends past end of pattern! ");
for (c = 0; c < 256; c++)
if (c / 8 < length
@@ -1736,8 +1737,11 @@ static int analyse_first _RE_ARGS ((re_char *p, re_char *pend,
/* This is not an arbitrary limit: the arguments which represent offsets
- into the pattern are two bytes long. So if 2^16 bytes turns out to
+ into the pattern are two bytes long. So if 2^15 bytes turns out to
be too small, many things would have to change. */
+# define MAX_BUF_SIZE (1L << 15)
+
+#if 0 /* This is when we thought it could be 2^16 bytes. */
/* Any other compiler which, like MSC, has allocation limit below 2^16
bytes will have to use approach similar to what was done below for
MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up
@@ -1749,6 +1753,7 @@ static int analyse_first _RE_ARGS ((re_char *p, re_char *pend,
#else
# define MAX_BUF_SIZE (1L << 16)
#endif
+#endif /* 0 */
/* Extend the buffer by twice its current size via realloc and
reset the pointers that pointed into the old block to point to the
@@ -4456,9 +4461,9 @@ skip_one_char (p)
/* Jump over non-matching operations. */
-static unsigned char *
+static re_char *
skip_noops (p, pend)
- unsigned char *p, *pend;
+ re_char *p, *pend;
{
int mcnt;
while (p < pend)
@@ -4487,7 +4492,7 @@ skip_noops (p, pend)
static int
mutually_exclusive_p (bufp, p1, p2)
struct re_pattern_buffer *bufp;
- unsigned char *p1, *p2;
+ re_char *p1, *p2;
{
re_opcode_t op2;
const boolean multibyte = RE_MULTIBYTE_P (bufp);