From a0f552b023917a5b5dac834a5b8d1ef5b82f27f5 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 23 Aug 2010 18:56:02 +0200 Subject: [PATCH] utils_match: Let '^' and '$' affect lines rather than the full string. The regcomp() flag REG_NEWLINE is required for that, even though regex(7) might make people think otherwise. --- src/utils_match.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils_match.c b/src/utils_match.c index e4240eab..2aaeb963 100644 --- a/src/utils_match.c +++ b/src/utils_match.c @@ -225,7 +225,7 @@ cu_match_t *match_create_callback (const char *regex, return (NULL); memset (obj, '\0', sizeof (cu_match_t)); - status = regcomp (&obj->regex, regex, REG_EXTENDED); + status = regcomp (&obj->regex, regex, REG_EXTENDED | REG_NEWLINE); if (status != 0) { ERROR ("Compiling the regular expression \"%s\" failed.", regex); -- 2.30.2