Skip to content

Commit f42cdf8

Browse files
committed
Fix paths issue when fetching .phpdbginit under Windows
1 parent 190478e commit f42cdf8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

sapi/phpdbg/phpdbg_prompt.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,12 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) /
346346
{
347347
if (!init_file && use_default) {
348348
char *scan_dir = getenv("PHP_INI_SCAN_DIR");
349+
char *sys_ini;
349350
int i;
350351

351-
phpdbg_try_file_init(PHPDBG_STRL(PHP_CONFIG_FILE_PATH "/" PHPDBG_INIT_FILENAME), 0);
352+
asprintf(&sys_ini, "%s/" PHPDBG_INIT_FILENAME, PHP_CONFIG_FILE_PATH);
353+
phpdbg_try_file_init(sys_ini, strlen(sys_ini), 0);
354+
free(sys_ini);
352355

353356
if (!scan_dir) {
354357
scan_dir = PHP_CONFIG_FILE_SCAN_DIR;

win32/build/config.w32.h.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define NTDDI_VERSION 0x06000100
1111

1212
/* Default PHP / PEAR directories */
13-
#define PHP_CONFIG_FILE_PATH (getenv("SystemRoot"))?getenv("SystemRoot"):""
13+
#define PHP_CONFIG_FILE_PATH (getenv("SystemRoot")?getenv("SystemRoot"):"")
1414
#define CONFIGURATION_FILE_PATH "php.ini"
1515
#define PEAR_INSTALLDIR "@PREFIX@\\pear"
1616
#define PHP_BINDIR "@PREFIX@"

0 commit comments

Comments
 (0)