aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-02-06 11:56:49 +0100
committerThomas White <taw@physics.org>2024-02-06 11:56:49 +0100
commitabf64f809ff96895c42254af4489b2f5eb95e4c6 (patch)
tree3b55114d00bd98823e2d897a354c9a65a0d903d7 /src
parentf76e0020e2b8361bba4347f7a6be273b2684593b (diff)
Sort-of-workaround for argp '--help' crash on MacOS
Indexamajig --help causes a segfault on MacOS due to a bug in argp-standalone. That package is unlikely to be updated any time soon. Eventually, Homebrew might switch to one of the non-crashy forks, but probably not soon. We aren't the only ones affected - see https://www.openwall.com/lists/musl/2021/02/10/1 This commit adds a warning message to state that we already know about it, and it's not "our" fault. It also removes the corresponding test, since we know it fails.
Diffstat (limited to 'src')
-rw-r--r--src/indexamajig.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index ce8b2cbf..aa0db210 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -1183,6 +1183,20 @@ int main(int argc, char *argv[])
{0}
};
+ #if defined(__APPLE__)
+ int q;
+ for ( q=0; q<argc; q++ ) {
+ if ( strcmp(argv[q], "--help") == 0 ) {
+ fprintf(stderr, "\n"
+ "WARNING: 'indexamajig --help' crashes on some Mac OS versions.\n"
+ "This is a known problem, and is due to a bug in external library "
+ "code.\n\n");
+ fflush(stderr);
+ break;
+ }
+ }
+ #endif
+
static struct argp argp = { options, parse_arg, NULL, doc,
argp_children, NULL, NULL };
if ( argp_parse(&argp, argc, argv, 0, NULL, &args) ) return 1;