From: Bob Weinand Date: Wed, 24 Jun 2015 22:35:52 +0000 (+0200) Subject: Fix paths issue when fetching .phpdbginit under Windows X-Git-Tag: php-7.0.0beta1~12^2~49^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f42cdf83b00182dc26ad11d3917a6275288b5b4b;p=php Fix paths issue when fetching .phpdbginit under Windows --- diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 146532f81e..3b1ec1f19a 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -346,9 +346,12 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) / { if (!init_file && use_default) { char *scan_dir = getenv("PHP_INI_SCAN_DIR"); + char *sys_ini; int i; - phpdbg_try_file_init(PHPDBG_STRL(PHP_CONFIG_FILE_PATH "/" PHPDBG_INIT_FILENAME), 0); + asprintf(&sys_ini, "%s/" PHPDBG_INIT_FILENAME, PHP_CONFIG_FILE_PATH); + phpdbg_try_file_init(sys_ini, strlen(sys_ini), 0); + free(sys_ini); if (!scan_dir) { scan_dir = PHP_CONFIG_FILE_SCAN_DIR; diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in index 3276fea705..b2ee6f1958 100644 --- a/win32/build/config.w32.h.in +++ b/win32/build/config.w32.h.in @@ -10,7 +10,7 @@ #define NTDDI_VERSION 0x06000100 /* Default PHP / PEAR directories */ -#define PHP_CONFIG_FILE_PATH (getenv("SystemRoot"))?getenv("SystemRoot"):"" +#define PHP_CONFIG_FILE_PATH (getenv("SystemRoot")?getenv("SystemRoot"):"") #define CONFIGURATION_FILE_PATH "php.ini" #define PEAR_INSTALLDIR "@PREFIX@\\pear" #define PHP_BINDIR "@PREFIX@"