aboutsummaryrefslogtreecommitdiff
path: root/src/grab.c
diff options
context:
space:
mode:
authorThomas Voss <thomas.voss@humanwave.nl> 2024-01-18 13:32:07 +0100
committerThomas Voss <thomas.voss@humanwave.nl> 2024-01-18 13:32:07 +0100
commit9246b498d19966545eaeb3f42fca16a6588a0129 (patch)
tree510eff4b1defc9886cd6d279fdf3a068b5c160c0 /src/grab.c
parent0c9b2e700e29e5bb6fca9caf8b95dfb0fe78142c (diff)
Compile with REG_DOTALL when -n is not provided
Diffstat (limited to 'src/grab.c')
-rw-r--r--src/grab.c8
1 files 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 <pcre2posix.h>
#else
# include <regex.h>
-
+# 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) {