summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2023-01-08 00:42:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2023-01-08 01:06:34 (GMT)
commit54463d32ef6798c772c8bbf69b2c1897a854db9f (patch)
tree0d731d9274083009674ac43a2b2963b8bda4297b /Makefile
parentc48035d29b4e524aed3a32f0403676f0d9128863 (diff)
downloadgit-54463d32ef6798c772c8bbf69b2c1897a854db9f.zip
git-54463d32ef6798c772c8bbf69b2c1897a854db9f.tar.gz
git-54463d32ef6798c772c8bbf69b2c1897a854db9f.tar.bz2
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 'Makefile')
-rw-r--r--Makefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b258fdb..093829a 100644
--- a/Makefile
+++ b/Makefile
@@ -289,6 +289,10 @@ include shared.mak
# Define NO_REGEX if your C library lacks regex support with REG_STARTEND
# feature.
#
+# Define USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS if your C library provides
+# the flag REG_ENHANCED and you'd like to use it to enable enhanced basic
+# regular expressions.
+#
# Define HAVE_DEV_TTY if your system can open /dev/tty to interact with the
# user.
#
@@ -2040,6 +2044,11 @@ endif
ifdef NO_REGEX
COMPAT_CFLAGS += -Icompat/regex
COMPAT_OBJS += compat/regex/regex.o
+else
+ifdef USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS
+ COMPAT_CFLAGS += -DUSE_ENHANCED_BASIC_REGULAR_EXPRESSIONS
+ COMPAT_OBJS += compat/regcomp_enhanced.o
+endif
endif
ifdef NATIVE_CRLF
BASIC_CFLAGS += -DNATIVE_CRLF