mirror of
https://github.com/git/git
synced 2024-08-28 20:20:07 +00:00
![René Scharfe](/assets/img/avatar_default.png)
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>
10 lines
213 B
C
10 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);
|
|
}
|