summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-01-23 13:39:51 -0800
committerJunio C Hamano <gitster@pobox.com>2023-01-23 13:39:51 -0800
commit5427bb4893e29a9502bbee5aed84c3b26e1a4e15 (patch)
tree9e8a02d927e20bc6259919e42f338d82cbca689d /git-compat-util.h
parentcd37c45acf8170aa80a4d7bd44ea5fc8241047f2 (diff)
parent54463d32ef6798c772c8bbf69b2c1897a854db9f (diff)
downloadgit-5427bb4893e29a9502bbee5aed84c3b26e1a4e15.tar.gz
Merge branch 'rs/use-enhanced-bre-on-macos'
Newer regex library macOS stopped enabling GNU-like enhanced BRE, where '\(A\|B\)' works as alternation, unless explicitly asked with the REG_ENHANCED flag. "git grep" now can be compiled to do so, to retain the old behaviour. * rs/use-enhanced-bre-on-macos: use enhanced basic regular expressions on macOS
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 6240fc0795..4f0028ce60 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -1357,6 +1357,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