From de87f92edf0a0b354a4bd327f03eeb9b27ca0fa8 Mon Sep 17 00:00:00 2001 From: TJ Saunders Date: Sat, 14 Aug 2021 15:29:57 -0700 Subject: [PATCH] Need to handle all of the regexp engine permutations better. --- src/regexp.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/regexp.c b/src/regexp.c index f17276f094..9c96e8d5c6 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -612,9 +612,20 @@ int pr_regexp_set_engine(const char *engine) { * only use POSIX. */ if (strcasecmp(engine, "POSIX") == 0) { + if (regexp_use_posix == FALSE) { + pr_trace_msg(trace_channel, 19, "%s", + "changed regexp engine from PCRE to POSIX"); + } + regexp_use_posix = TRUE; - pr_trace_msg(trace_channel, 19, "%s", - "changed regexp engine from PCRE to POSIX"); + + } else { + if (regexp_use_posix == TRUE) { + pr_trace_msg(trace_channel, 19, "%s", + "changed regexp engine from POSIX to PCRE"); + } + + regexp_use_posix = FALSE; } #else /* We only use POSIX, but are being requested to use PCRE. */