Skip to content

Commit

Permalink
Removed CWD from php_ini_search_path when using CLI SAPI.
Browse files Browse the repository at this point in the history
  • Loading branch information
edinkad committed Feb 28, 2002
1 parent 83059ae commit ab25640
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions main/php_ini.c
Expand Up @@ -27,6 +27,7 @@
#include "ext/standard/dl.h" #include "ext/standard/dl.h"
#include "zend_extensions.h" #include "zend_extensions.h"
#include "zend_highlight.h" #include "zend_highlight.h"
#include "SAPI.h"


typedef struct _php_extension_lists { typedef struct _php_extension_lists {
zend_llist engine; zend_llist engine;
Expand Down Expand Up @@ -239,10 +240,18 @@ int php_init_config(char *php_ini_path_override)
#endif #endif
php_ini_search_path = (char *) emalloc(sizeof(".")+strlen(env_location)+strlen(default_location)+2+1); php_ini_search_path = (char *) emalloc(sizeof(".")+strlen(env_location)+strlen(default_location)+2+1);
free_ini_search_path = 1; free_ini_search_path = 1;
if(env_location && env_location[0]) { if (strcmp(sapi_module.name, "cli")==0) {
sprintf(php_ini_search_path, ".%c%s%c%s", ZEND_PATHS_SEPARATOR, env_location, ZEND_PATHS_SEPARATOR, default_location); 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 { } 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) { if (free_default_location) {
efree(default_location); efree(default_location);
Expand Down

0 comments on commit ab25640

Please sign in to comment.