diff options
author | René Scharfe <l.s.r@web.de> | 2023-01-08 01:42:04 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-01-08 10:06:34 +0900 |
commit | 54463d32ef6798c772c8bbf69b2c1897a854db9f (patch) | |
tree | 0d731d9274083009674ac43a2b2963b8bda4297b /git-compat-util.h | |
parent | c48035d29b4e524aed3a32f0403676f0d9128863 (diff) | |
download | git-54463d32ef6798c772c8bbf69b2c1897a854db9f.tar.gz |
use enhanced basic regular expressions on macOS
When 1819ad327b (grep: fix multibyte regex handling under macOS,
2022-08-26) started to use the native regex library instead of Git's
own (compat/regex/), it lost support for alternation in basic
regular expressions.
Bring it back by enabling the flag REG_ENHANCED on macOS when
compiling basic regular expressions.
Reported-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r-- | git-compat-util.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index a76d0526f7..4824c8cad4 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -1336,6 +1336,11 @@ static inline int regexec_buf(const regex_t *preg, const char *buf, size_t size, return regexec(preg, buf, nmatch, pmatch, eflags | REG_STARTEND); } +#ifdef USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS +int git_regcomp(regex_t *preg, const char *pattern, int cflags); +#define regcomp git_regcomp +#endif + #ifndef DIR_HAS_BSD_GROUP_SEMANTICS # define FORCE_DIR_SET_GID S_ISGID #else |