From ddae845f969b793c326b9c3aa8f18b60b6335727 Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Tue, 18 Sep 2007 13:32:31 +0000 Subject: [PATCH] _POSIX2_RE_DUP_MAX git-svn: trunk@3226 --- ChangeLog | 7 ++++++- libclamav/regex/regcomp.c | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 183f344d3..22d7f38bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,12 @@ +Tue Sep 18 13:45:34 BST 2007 (njh) +---------------------------------- + * libclamav/regex/regcomp.c: Fix compilation error on systems without + _POSIX2_RE_DUP_MAX (under advice from Edwin) + Mon Sep 17 21:06:59 EEST 2007(edwin) ------------------------------------ * libclamav/regex/: add regcomp(), regexec() impl. from OpenBSD's libc. - This code is licensed under the 3-clause BSD. + This code is licensed under the 3-clause BSD. This will be used instead of system provided regexec()/regcomp() to have consistent behaviour across platforms. diff --git a/libclamav/regex/regcomp.c b/libclamav/regex/regcomp.c index 3d22004f8..5e74949ef 100644 --- a/libclamav/regex/regcomp.c +++ b/libclamav/regex/regcomp.c @@ -138,6 +138,12 @@ static char nuls[10]; /* place to point scanner in event of error */ #define THERETHERE() (p->slen - 2) #define DROP(n) (p->slen -= (n)) +#ifdef _POSIX2_RE_DUP_MAX +#define DUPMAX _POSIX2_RE_DUP_MAX +#else +#define DUPMAX 255 +#endif + #ifndef NDEBUG static int never = 0; /* for use in asserts; shuts lint up */ #else