bjori Thu May 10 19:51:19 2007 UTC
Modified files:
/php-src/main php_ini.c
Log:
MFB - use php_strtok_r() rather than strsep()
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.150&r2=1.151&diff_format=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.150 php-src/main/php_ini.c:1.151
--- php-src/main/php_ini.c:1.150 Wed Apr 25 10:02:23 2007
+++ php-src/main/php_ini.c Thu May 10 19:51:19 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ini.c,v 1.150 2007/04/25 10:02:23 bjori Exp $ */
+/* $Id: php_ini.c,v 1.151 2007/05/10 19:51:19 bjori Exp $ */
#include "php.h"
#include "ext/standard/info.h"
@@ -357,13 +357,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) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php