From 411e92fea9621630eb350e0c2bb43543e553b84f Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Tue, 28 Jun 2011 19:05:43 +1000 Subject: Change the builtin regexp to avoid compiling twice Simply guess the program size and realloc if needed. This also fixes a compile warning on some platforms. Signed-off-by: Steve Bennett --- jimregexp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'jimregexp.h') diff --git a/jimregexp.h b/jimregexp.h index 336e20e..79a87e5 100644 --- a/jimregexp.h +++ b/jimregexp.h @@ -56,14 +56,14 @@ typedef struct regexp { int err; /* Any error which occurred during compile */ int regstart; /* Internal use only. */ int reganch; /* Internal use only. */ - const int *regmust; /* Internal use only. */ + int regmust; /* Internal use only. */ int regmlen; /* Internal use only. */ int *program; /* Allocated */ /* working state - compile */ const char *regparse; /* Input-scan pointer. */ - int *regcode; /* Code-emit pointer; ®dummy = don't. */ - long regsize; /* Code size. */ + int p; /* Current output pos in program */ + int proglen; /* Allocated program size */ /* working state - exec */ int eflags; /* Flags used when executing */ -- cgit v1.1