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
This commit is contained in:
9
compat/regcomp_enhanced.c
Normal file
9
compat/regcomp_enhanced.c
Normal file
@ -0,0 +1,9 @@
|
||||
#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);
|
||||
}
|
Reference in New Issue
Block a user