Merge branch 'jc/macos-homebrew-wo-reg-enhanced' into next

In case homebrew breaks REG_ENHANCED again, leave a in-code comment
to suggest use of our replacement regex as a workaround.

* jc/macos-homebrew-wo-reg-enhanced:
  regexp: leave a pointer to resurrect workaround for Homebrew
Junio C Hamano 2026-03-26 11:18:52 -07:00
commit ce92a76711
1 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,11 @@

int git_regcomp(regex_t *preg, const char *pattern, int cflags)
{
/*
* If you are on macOS with clang and fail to compile this line,
* https://lore.kernel.org/git/458ad3c1-96df-4575-ee42-e6eb754f25f6@gmx.de/
* might be relevant.
*/
if (!(cflags & REG_EXTENDED))
cflags |= REG_ENHANCED;
return regcomp(preg, pattern, cflags);