cvs: php-src(PHP_5_2) /main php_ini.c
| From: | Hannes Magnusson | Date: | Thu, 10 May 2007 19:48:30 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /main php_ini.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-44256@lists.php.net to get a copy of this message | ||
bjori Thu May 10 19:48:30 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/main php_ini.c
Log:
use php_strtok_r() rather than strsep()
# Fixes build on, for instance, solaris
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.136.2.4.2.9&r2=1.136.2.4.2.10&diff_format=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.136.2.4.2.9 php-src/main/php_ini.c:1.136.2.4.2.10
--- php-src/main/php_ini.c:1.136.2.4.2.9 Sun May 6 14:01:26 2007
+++ php-src/main/php_ini.c Thu May 10 19:48:30 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ini.c,v 1.136.2.4.2.9 2007/05/06 14:01:26 bjori Exp $ */
+/* $Id: php_ini.c,v 1.136.2.4.2.10 2007/05/10 19:48:30 bjori Exp $ */
#include "php.h"
#include "ext/standard/info.h"
@@ -359,13 +359,16 @@
if ((path = getenv("PATH")) != NULL) {
char *search_dir, search_path[MAXPATHLEN];
+ char *last;
- while ((search_dir = strsep(&path, ":")) != NULL) {
+ search_dir = php_strtok_r(path, ":", &last);
+ while (search_dir) {
snprintf(search_path, MAXPATHLEN, "%s/%s", search_dir,
sapi_module.executable_location);
if (VCWD_REALPATH(search_path, binary_location) && !VCWD_ACCESS(binary_location,
X_OK)) {
found = 1;
break;
}
+ search_dir = php_strtok_r(NULL, ":", &last);
}
}
if (!found) {