git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC v2 0/3] Update compat/regex

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 17, 2010, 08:03 UTC
Message-ID
<20100817080322.GA28476@burratino>
In-Reply-To
<1282022233-32692-1-git-send-email-avarab@gmail.com>
Ævar Arnfjörð Bjarmason wrote:
> Ævar Arnfjörð Bjarmason (3):
>   compat/regex: use the regex engine from gawk for compat
>   compat/regex: get the gawk regex engine to compile within git
>   t/t7008-grep-binary.sh: un-TODO a test that needs REG_STARTEND
For what it’s worth:
Acked-by: Jonathan Nieder <jrnieder@gmail.com>

Thanks. Here’s a patch to go on top. I am not sure what platforms support REG_STARTEND, but we can always update the makefile as reports come in.

-- 8< --
Subject: autoconf: don't use platform regex if it lacks REG_STARTEND

If the platform regex cannot match null bytes, we might as well use the glibc version instead.

Cc: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Cc: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 config.mak.in |    1 +
 configure.ac  |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/config.mak.in b/config.mak.in
index b4e65c3..67dbd3b 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -58,6 +58,7 @@ NO_INET_NTOP=@NO_INET_NTOP@
 NO_INET_PTON=@NO_INET_PTON@
 NO_ICONV=@NO_ICONV@
 OLD_ICONV=@OLD_ICONV@
+NO_REGEX=@NO_REGEX@
 NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
 INLINE=@INLINE@
 SOCKLEN_T=@SOCKLEN_T@
diff --git a/configure.ac b/configure.ac
index 5601e8b..71ac89f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -706,6 +706,27 @@ else
 fi
 AC_SUBST(NO_C99_FORMAT)
 #
+# Define NO_REGEX if you have no or inferior regex support in your C library.
+AC_CACHE_CHECK([whether the platform regex can handle null bytes],
+ [ac_cv_c_excellent_regex], [
+AC_EGREP_CPP(yippeeyeswehaveit,
+	AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
+#include <regex.h>
+],
+[#ifdef REG_STARTEND
+yippeeyeswehaveit
+#endif
+]),
+	[ac_cv_c_excellent_regex=yes],
+	[ac_cv_c_excellent_regex=yes])
+])
+if test $ac_cv_c_excellent_regex = yes; then
+	NO_REGEX=
+else
+	NO_REGEX=YesPlease
+fi
+AC_SUBST(NO_REGEX)
+#
 # Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
 # when attempting to read from an fopen'ed directory.
 AC_CACHE_CHECK([whether system succeeds to read fopen'ed directory],
-- 
1.7.2.1.544.ga752d.dirty
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 22 of 36 in “grep: Don't pass a TODO test if REG_STARTEND is supported”
  1. grep: Don't pass a TODO test if REG_STARTEND is supportedÆvar Arnfjörð Bjarmason, Jul 8, 2010
  2. Junio C HamanoJul 8, 2010
  3. Ævar Arnfjörð BjarmasonJul 8, 2010
  4. René ScharfeJul 8, 2010
  5. Ævar Arnfjörð BjarmasonJul 15, 2010
  6. Junio C HamanoJul 15, 2010
  7. Ævar Arnfjörð BjarmasonJul 15, 2010
  8. Ævar Arnfjörð BjarmasonJul 16, 2010
  9. Jonathan NiederJul 16, 2010
  10. Ævar Arnfjörð BjarmasonJul 16, 2010
  11. Jonathan NiederJul 16, 2010
  12. Ævar Arnfjörð BjarmasonJul 16, 2010
  13. Ævar Arnfjörð BjarmasonJul 16, 2010
  14. Andreas SchwabJul 16, 2010
  15. Ævar Arnfjörð BjarmasonAug 15, 2010
  16. Paolo BonziniAug 16, 2010
  17. 0/3 Update compat/regexÆvar Arnfjörð Bjarmason, Aug 17, 2010
  18. 2/3 compat/regex: hacks to get the gawk regex engine to compile within gitÆvar Arnfjörð Bjarmason, Aug 17, 2010
  19. Jonathan NiederAug 17, 2010
  20. 3/3 t/t7008-grep-binary.sh: un-TODO a test that needs REG_STARTENDÆvar Arnfjörð Bjarmason, Aug 17, 2010
  21. 0/3 Update compat/regexÆvar Arnfjörð Bjarmason, Aug 17, 2010
  22. Jonathan NiederAug 17, 2010
  23. 0/5 Update compat/regexÆvar Arnfjörð Bjarmason, Aug 17, 2010
  24. Paolo BonziniAug 17, 2010
  25. Junio C HamanoAug 17, 2010
  26. Jonathan NiederAug 17, 2010
  27. Ævar Arnfjörð BjarmasonAug 18, 2010
  28. 2/5 compat/regex: get the gawk regex engine to compile within gitÆvar Arnfjörð Bjarmason, Aug 17, 2010
  29. 3/5 Change regerror() declaration from K&R style to ANSI C (C89)Ævar Arnfjörð Bjarmason, Aug 17, 2010
  30. 4/5 t/t7008-grep-binary.sh: un-TODO a test that needs REG_STARTENDÆvar Arnfjörð Bjarmason, Aug 17, 2010
  31. 5/5 autoconf: don't use platform regex if it lacks REG_STARTENDÆvar Arnfjörð Bjarmason, Aug 17, 2010
  32. 2/3 compat/regex: get the gawk regex engine to compile within gitÆvar Arnfjörð Bjarmason, Aug 17, 2010
  33. 3/3 t/t7008-grep-binary.sh: un-TODO a test that needs REG_STARTENDÆvar Arnfjörð Bjarmason, Aug 17, 2010
  34. Jonathan NiederAug 17, 2010
  35. Ævar Arnfjörð BjarmasonAug 17, 2010
  36. Jonathan NiederAug 17, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.