Loading...
--- Libc/Libc-498.1.1/gen/FreeBSD/assert.c.patch
+++ Libc/Libc-594.9.5/gen/FreeBSD/assert.c.patch
@@ -1,11 +1,45 @@
---- assert.c.orig 2004-09-20 17:32:51.000000000 -0700
-+++ assert.c 2004-11-17 15:56:24.000000000 -0800
-@@ -42,7 +42,7 @@
+--- assert.c.orig 2008-09-06 16:27:37.000000000 -0700
++++ assert.c 2008-09-07 01:35:02.000000000 -0700
+@@ -41,20 +41,39 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/ass
+ #include <stdio.h>
#include <stdlib.h>
++extern const char *__crashreporter_info__;
++static const char badasprintf[] =
++ "Assertion failed and asprintf also failed to create full error string";
++
void
-__assert(func, file, line, failedexpr)
+__assert_rtn(func, file, line, failedexpr)
const char *func, *file;
int line;
const char *failedexpr;
+ {
+- if (func == NULL)
++ char *str = NULL;
++
++ if (func == NULL) {
+ (void)fprintf(stderr,
+ "Assertion failed: (%s), file %s, line %d.\n", failedexpr,
+ file, line);
+- else
++ if (!__crashreporter_info__) {
++ asprintf(&str,
++ "Assertion failed: (%s), file %s, line %d.\n",
++ failedexpr, file, line);
++ __crashreporter_info__ = str ? str : badasprintf;
++ }
++ } else {
+ (void)fprintf(stderr,
+ "Assertion failed: (%s), function %s, file %s, line %d.\n",
+ failedexpr, func, file, line);
++ if (!__crashreporter_info__) {
++ asprintf(&str,
++ "Assertion failed: (%s), function %s, file %s, line %d.\n",
++ failedexpr, func, file, line);
++ __crashreporter_info__ = str ? str : badasprintf;
++ }
++ }
+ abort();
+ /* NOTREACHED */
+ }