cvs: php4 /main php_ini.c

From: Date: Thu, 28 Feb 2002 12:12:39 +0000
Subject: cvs: php4 /main php_ini.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-9505@lists.php.net to get a copy of this message
edink Thu Feb 28 07:12:39 2002 EDT Modified files: /php4/main php_ini.c Log: Removed CWD from php_ini_search_path when using CLI SAPI. Index: php4/main/php_ini.c diff -u php4/main/php_ini.c:1.77 php4/main/php_ini.c:1.78 --- php4/main/php_ini.c:1.77 Tue Dec 11 10:31:04 2001 +++ php4/main/php_ini.c Thu Feb 28 07:12:39 2002 @@ -27,6 +27,7 @@ #include "ext/standard/dl.h" #include "zend_extensions.h" #include "zend_highlight.h" +#include "SAPI.h" typedef struct _php_extension_lists { zend_llist engine; @@ -239,10 +240,18 @@ #endif php_ini_search_path = (char *) emalloc(sizeof(".")+strlen(env_location)+strlen(default_location)+2+1); free_ini_search_path = 1; - if(env_location && env_location[0]) { - sprintf(php_ini_search_path, ".%c%s%c%s", ZEND_PATHS_SEPARATOR, env_location, ZEND_PATHS_SEPARATOR, default_location); + if (strcmp(sapi_module.name, "cli")==0) { + if(env_location && env_location[0]) { + sprintf(php_ini_search_path, "%s%c%s", env_location, ZEND_PATHS_SEPARATOR, default_location); + } else { + sprintf(php_ini_search_path, "%s", default_location); + } } else { - sprintf(php_ini_search_path, ".%c%s", ZEND_PATHS_SEPARATOR, default_location); + if(env_location && env_location[0]) { + sprintf(php_ini_search_path, ".%c%s%c%s", ZEND_PATHS_SEPARATOR, env_location, ZEND_PATHS_SEPARATOR, default_location); + } else { + sprintf(php_ini_search_path, ".%c%s", ZEND_PATHS_SEPARATOR, default_location); + } } if (free_default_location) { efree(default_location);

« previous php.cvs (#9505) next »