]> granicus.if.org Git - mutt/commitdiff
Rename _regex.h to _mutt_regex.h to avoid name collision on Macs.
authorKevin McCarthy <kevin@8t8.us>
Sun, 8 Apr 2018 22:37:09 +0000 (15:37 -0700)
committerKevin McCarthy <kevin@8t8.us>
Mon, 9 Apr 2018 22:31:45 +0000 (15:31 -0700)
On Macs, <regex.h> includes <_regex.h>.  Because Mutt defines '-I .'
during compilation, our bundled version of _regex.h was being used
instead of the system one.

I have no idea how it managed to work before, but starting in Xcode
9.3, the differences in struct size and fields started to produce a
crash and other strange behavior.

The real issue is our use of '-I .' during compilation, which allows
our local headers to override system ones.  An easier fix for now is
to rename the header.

Many thanks to Charles Diza, Christian Ebert, and Fabian Groffen for
their help trying things out and helping to debug the problem.

Also, a huge thanks to Steve Karmeinsky for allowing me to ssh in to
his Mac so I could track down the underlying issue.

Makefile.am
_mutt_regex.h [moved from _regex.h with 100% similarity]
mutt_regex.h
regex.c

index cd547d78c1595fe682ba32e5768a0dd9eac28585..1c2e9a78860cf4b28c2e837650d5d37e3efced17 100644 (file)
@@ -71,7 +71,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \
        mutt_regex.h mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
        mx.h pager.h pgp.h pop.h protos.h rfc1524.h rfc2047.h \
        rfc2231.h rfc822.h rfc3676.h sha1.h sort.h mime.types VERSION prepare \
-       _regex.h OPS.MIX README.SECURITY remailer.c remailer.h browser.h \
+       _mutt_regex.h OPS.MIX README.SECURITY remailer.c remailer.h browser.h \
        mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h \
        README.SSL smime.h group.h \
        muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
similarity index 100%
rename from _regex.h
rename to _mutt_regex.h
index 1cc4a3e2e9772723444d67d492a7ccf6c31504a4..c89a2f43cea3bc294bf60b980e64fefcf30ea59a 100644 (file)
@@ -24,7 +24,7 @@
 #define MUTT_REGEX_H
 
 #ifdef USE_GNU_REGEX
-#include "_regex.h"
+#include "_mutt_regex.h"
 #else
 #include <regex.h>
 #endif
diff --git a/regex.c b/regex.c
index fbec647ebb7d26b8626b5c79578e84e7fef93426..cfbfb58f061ed3be84329a1476d10e5a7d8d3cca 100644 (file)
--- a/regex.c
+++ b/regex.c
@@ -212,7 +212,7 @@ init_syntax_once ()
 
 /* Changed to fit into mutt - tlr, 1999-01-06 */
 
-#include "_regex.h"
+#include "_mutt_regex.h"
 
 /* isalpha etc. are used for the character classes.  */
 #include <ctype.h>