tony2001 Mon May 14 12:19:34 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/main php_ini.c Log: MFH http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.136.2.4.2.11&r2=1.136.2.4.2.12&diff_format=u Index: php-src/main/php_ini.c diff -u php-src/main/php_ini.c:1.136.2.4.2.11 php-src/main/php_ini.c:1.136.2.4.2.12 --- php-src/main/php_ini.c:1.136.2.4.2.11 Sat May 12 16:06:46 2007 +++ php-src/main/php_ini.c Mon May 14 12:19:34 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_ini.c,v 1.136.2.4.2.11 2007/05/12 16:06:46 bjori Exp $ */ +/* $Id: php_ini.c,v 1.136.2.4.2.12 2007/05/14 12:19:34 tony2001 Exp $ */ #include "php.h" #include "ext/standard/info.h" @@ -360,11 +360,10 @@ if ((envpath = getenv("PATH")) != NULL) { char *search_dir, search_path[MAXPATHLEN]; char *last; - int pathlen = strlen(envpath) + 1; - path = malloc(pathlen); - memcpy(path, envpath, pathlen); + path = estrdup(envpath); 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)) { @@ -373,6 +372,7 @@ } search_dir = php_strtok_r(NULL, ":", &last); } + efree(path); } if (!found) { efree(binary_location);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php