From 9246b498d19966545eaeb3f42fca16a6588a0129 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 18 Jan 2024 13:32:07 +0100 Subject: Compile with REG_DOTALL when -n is not provided --- src/grab.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/grab.c b/src/grab.c index 15eb3eb..7571b19 100644 --- a/src/grab.c +++ b/src/grab.c @@ -12,7 +12,9 @@ # include #else # include - +# ifdef REG_DOTALL +# define REG_DOTALL 0 +# endif # define REG_UCP 0 # define REG_UTF 0 # ifndef REG_STARTEND @@ -463,9 +465,7 @@ mkregex(char *s, size_t n) regex_t r; s[n] = 0; - cflags = REG_EXTENDED | REG_UTF; - if (nflag) - cflags |= REG_NEWLINE; + cflags = REG_EXTENDED | REG_UTF | (nflag ? REG_NEWLINE : REG_DOTALL); if (!Uflag) cflags |= REG_UCP; if ((ret = regcomp(&r, s, cflags)) != 0) { -- cgit v1.2.3