From 0bdf1d76f36b34ac32a677c5f872a95f5d5913a1 Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Sun, 30 Mar 2008 18:29:57 +0200 Subject: [PATCH] mpdm_regex() returns NULL even with the 'g' flag. --- mpdm_r.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mpdm_r.c b/mpdm_r.c index 998298c..4ef398f 100644 --- a/mpdm_r.c +++ b/mpdm_r.c @@ -278,6 +278,10 @@ mpdm_t mpdm_regex(mpdm_t r, const mpdm_t v, int offset) offset = mpdm_regex_offset + mpdm_regex_size; } + + /* no matches? convert to NULL */ + if (size(w) == 0) + w = NULL; } else w = regex1(r, v, offset); -- 2.11.4.GIT