diff options
author | Alex Dupre <ale@FreeBSD.org> | 2008-06-09 12:11:33 +0000 |
---|---|---|
committer | Alex Dupre <ale@FreeBSD.org> | 2008-06-09 12:11:33 +0000 |
commit | 388c8b6c6db14a0c865ff274c6193378ccdeb6ab (patch) | |
tree | 37364cd030ae3bf30854acb3dcb4eca999090e46 | |
parent | 42960df8dfae025492571d7d76bfd89e586348b2 (diff) | |
download | ports-388c8b6c6db14a0c865ff274c6193378ccdeb6ab.tar.gz ports-388c8b6c6db14a0c865ff274c6193378ccdeb6ab.zip |
FreeBSD >= 700050 has POSIX standard putenv().
PR: ports/123911
Submitted by: scf
Notes
Notes:
svn path=/head/; revision=214543
-rw-r--r-- | lang/php5/files/patch-ext_standard_basic_functions.c | 21 | ||||
-rw-r--r-- | lang/php53/files/patch-ext_standard_basic_functions.c | 21 |
2 files changed, 16 insertions, 26 deletions
diff --git a/lang/php5/files/patch-ext_standard_basic_functions.c b/lang/php5/files/patch-ext_standard_basic_functions.c index 44f865d2da3f..9ef6dd343cbf 100644 --- a/lang/php5/files/patch-ext_standard_basic_functions.c +++ b/lang/php5/files/patch-ext_standard_basic_functions.c @@ -1,5 +1,5 @@ ---- ext/standard/basic_functions.c.orig 2008-05-02 08:44:06.000000000 +0200 -+++ ext/standard/basic_functions.c 2008-05-02 08:54:00.000000000 +0200 +--- 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 @@ -8,26 +8,21 @@ #ifdef HARTMUT_0 #include <getopt.h> #endif -@@ -3861,9 +3862,7 @@ +@@ -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 + # endif } else { - # if HAVE_UNSETENV - unsetenv(pe->key); -@@ -4463,12 +4462,8 @@ +@@ -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 -- pe.previous_value = *env; --#endif - break; - } - } + #else diff --git a/lang/php53/files/patch-ext_standard_basic_functions.c b/lang/php53/files/patch-ext_standard_basic_functions.c index 44f865d2da3f..9ef6dd343cbf 100644 --- a/lang/php53/files/patch-ext_standard_basic_functions.c +++ b/lang/php53/files/patch-ext_standard_basic_functions.c @@ -1,5 +1,5 @@ ---- ext/standard/basic_functions.c.orig 2008-05-02 08:44:06.000000000 +0200 -+++ ext/standard/basic_functions.c 2008-05-02 08:54:00.000000000 +0200 +--- 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 @@ -8,26 +8,21 @@ #ifdef HARTMUT_0 #include <getopt.h> #endif -@@ -3861,9 +3862,7 @@ +@@ -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 + # endif } else { - # if HAVE_UNSETENV - unsetenv(pe->key); -@@ -4463,12 +4462,8 @@ +@@ -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 -- pe.previous_value = *env; --#endif - break; - } - } + #else |