From c85e26cb06814b65859be5f1aa265ac12a40ee33 Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Thu, 10 May 2007 19:51:19 +0000 Subject: [PATCH] MFB - use php_strtok_r() rather than strsep() --- main/php_ini.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/php_ini.c b/main/php_ini.c index 9af002e1aa..8a7b5594ac 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -357,13 +357,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) { -- 2.50.1