]> granicus.if.org Git - php/commitdiff
Fix paths issue when fetching .phpdbginit under Windows
authorBob Weinand <bobwei9@hotmail.com>
Wed, 24 Jun 2015 22:35:52 +0000 (00:35 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Wed, 24 Jun 2015 22:36:01 +0000 (00:36 +0200)
sapi/phpdbg/phpdbg_prompt.c
win32/build/config.w32.h.in

index 146532f81eaf51d4b9047ab4e4a19a23b79a42a7..3b1ec1f19afe851700c9c2422c1411a89daa5001 100644 (file)
@@ -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;
index 3276fea705069b3e86181660bc526f6e08d99a7e..b2ee6f195864d370139f6b02b215baeacb681355 100644 (file)
@@ -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@"