freebsd-ports/lang/php52/files/patch-ext_standard_basic_functions.c
Dirk Meyer 3acf4c24e2 PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML.  Its syntax draws upon C,
Java, and Perl, and is easy to learn.  The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.

WWW: http://www.php.net/
PR:		145772
Submitted by:	Alex Keda
2010-04-23 15:03:13 +00:00

28 lines
927 B
C

--- ext/standard/basic_functions.c.orig 2008-06-09 14:06:40.000000000 +0200
+++ ext/standard/basic_functions.c 2008-06-09 14:08:28.000000000 +0200
@@ -87,6 +87,7 @@
# include <sys/loadavg.h>
#endif
+#define HARTMUT_0
#ifdef HARTMUT_0
#include <getopt.h>
#endif
@@ -3859,7 +3860,7 @@
SetEnvironmentVariable(pe->key, "bugbug");
#endif
putenv(pe->previous_value);
-# if defined(PHP_WIN32)
+# if defined(PHP_WIN32) || __FreeBSD_version < 700050
efree(pe->previous_value);
# endif
} else {
@@ -4461,7 +4462,7 @@
pe.previous_value = NULL;
for (env = environ; env != NULL && *env != NULL; env++) {
if (!strncmp(*env, pe.key, pe.key_len) && (*env)[pe.key_len] == '=') { /* found it */
-#if defined(PHP_WIN32)
+#if defined(PHP_WIN32) || __FreeBSD_version < 700050
/* must copy previous value because MSVCRT's putenv can free the string without notice */
pe.previous_value = estrdup(*env);
#else