$NetBSD: patch-aj,v 1.5 2003/09/01 10:17:39 cjep Exp $ --- ext/gettext/gettext.c.orig 2003-08-30 21:56:34.000000000 +0200 +++ ext/gettext/gettext.c 2003-08-30 21:57:13.000000000 +0200 @@ -58,6 +58,11 @@ }; /* }}} */ +#define CHECK(a) if (a == NULL) { \ + fprintf(stderr, "%s, %d: NULL value\n", __FILE__, __LINE__); \ + a = ""; \ +} + zend_module_entry php_gettext_module_entry = { STANDARD_MODULE_HEADER, "gettext", @@ -104,6 +109,7 @@ retval = textdomain(domain_name); + CHECK(retval); RETURN_STRING(retval, 1); } /* }}} */ @@ -141,6 +147,7 @@ msgstr = dgettext(Z_STRVAL_PP(domain_name), Z_STRVAL_PP(msgid)); + CHECK(msgstr); RETURN_STRING(msgstr, 1); } /* }}} */ @@ -161,6 +168,7 @@ msgstr = dcgettext(Z_STRVAL_PP(domain_name), Z_STRVAL_PP(msgid), Z_LVAL_PP(category)); + CHECK(msgstr); RETURN_STRING(msgstr, 1); } /* }}} */ @@ -191,6 +199,7 @@ retval = bindtextdomain(Z_STRVAL_PP(domain_name), dir_name); + CHECK(retval); RETURN_STRING(retval, 1); } /* }}} */