Skip to content

Instantly share code, notes, and snippets.

@waltarix
Created December 8, 2011 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waltarix/1446162 to your computer and use it in GitHub Desktop.
Save waltarix/1446162 to your computer and use it in GitHub Desktop.
w3m: Fix segfault issue with bdw-gc 7.2
diff --git a/main.c b/main.c
index b421943..865c744 100644
--- a/main.c
+++ b/main.c
@@ -833,7 +833,12 @@ main(int argc, char **argv, char **envp)
mySignal(SIGPIPE, SigPipe);
#endif
+#if GC_VERSION_MAJOR >= 7 && GC_VERSION_MINOR >= 2
+ orig_GC_warn_proc = GC_get_warn_proc();
+ GC_set_warn_proc(wrap_GC_warn_proc);
+#else
orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc);
+#endif
err_msg = Strnew();
if (load_argc == 0) {
/* no URL specified */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment