diff options
author | Thomas Voss <thomas.voss@humanwave.nl> | 2024-01-18 13:32:07 +0100 |
---|---|---|
committer | Thomas Voss <thomas.voss@humanwave.nl> | 2024-01-18 13:32:07 +0100 |
commit | 9246b498d19966545eaeb3f42fca16a6588a0129 (patch) | |
tree | 510eff4b1defc9886cd6d279fdf3a068b5c160c0 /src | |
parent | 0c9b2e700e29e5bb6fca9caf8b95dfb0fe78142c (diff) |
Compile with REG_DOTALL when -n is not provided
Diffstat (limited to 'src')
-rw-r--r-- | src/grab.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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) { |