summaryrefslogtreecommitdiff
path: root/main/php_ini.c
diff options
context:
space:
mode:
authorHannes Magnusson <bjori@php.net>2007-05-10 19:48:30 +0000
committerHannes Magnusson <bjori@php.net>2007-05-10 19:48:30 +0000
commit63c11738f8efe8dc6a3fc2719df105eaafb98f0f (patch)
tree7726b6f61c1ffdb7cea12b5106eb58d3c1bccbcf /main/php_ini.c
parent7efde494d7b925d3a54453d2a34f9ab93a2dc00c (diff)
downloadphp-git-63c11738f8efe8dc6a3fc2719df105eaafb98f0f.tar.gz
use php_strtok_r() rather than strsep()
# Fixes build on, for instance, solaris
Diffstat (limited to 'main/php_ini.c')
-rw-r--r--main/php_ini.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/php_ini.c b/main/php_ini.c
index ae39d81d5b..aa9a96ceeb 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -359,13 +359,16 @@ int php_init_config(TSRMLS_D)
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) {