mirror of
https://github.com/git/git
synced 2024-10-30 04:01:21 +00:00
54463d32ef
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>
9 lines
213 B
C
9 lines
213 B
C
#include "../git-compat-util.h"
|
|
#undef regcomp
|
|
|
|
int git_regcomp(regex_t *preg, const char *pattern, int cflags)
|
|
{
|
|
if (!(cflags & REG_EXTENDED))
|
|
cflags |= REG_ENHANCED;
|
|
return regcomp(preg, pattern, cflags);
|
|
}
|