com php-src: Support also multiple directories in additional ini scan dir: phpdbg_prompt.c

From: Date: Mon, 25 Nov 2013 16:15:51 +0000
Subject: com php-src: Support also multiple directories in additional ini scan dir: phpdbg_prompt.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-74614@lists.php.net to get a copy of this message
Commit: eac26190aa466fd1d768b5efa6f3c644f1d4317f Author: Bob Weinand <bobwei9@hotmail.com> Mon, 25 Nov 2013 17:15:51 +0100 Parents: 4aab420c5f0727df86414c2663935b151928d132 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=eac26190aa466fd1d768b5efa6f3c644f1d4317f Log: Support also multiple directories in additional ini scan dir Changed paths: M phpdbg_prompt.c Diff: diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index e9b484f..fd4c8ac 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -157,15 +157,32 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TS { if (!init_file && use_default) { char *scan_dir = getenv("PHP_INI_SCAN_DIR"); + int i; phpdbg_try_file_init(ZEND_STRS(PHP_CONFIG_FILE_PATH "/" PHPDBG_INIT_FILENAME) - 1 , 0 TSRMLS_CC); if (!scan_dir) { scan_dir = PHP_CONFIG_FILE_SCAN_DIR; } - init_file = malloc(strlen(scan_dir) + sizeof(PHPDBG_INIT_FILENAME)); - sprintf(init_file, "%s/%s", scan_dir, PHPDBG_INIT_FILENAME); - phpdbg_try_file_init(init_file, strlen(init_file), 1 TSRMLS_CC); + while (*scan_dir != 0) { + i = 0; + while (scan_dir[i] != ':') { + if (scan_dir[i++] == 0) { + i = -1; + break; + } + } + if (i != -1) { + scan_dir[i] = 0; + } + init_file = malloc(strlen(scan_dir) + sizeof(PHPDBG_INIT_FILENAME)); + sprintf(init_file, "%s/%s", scan_dir, PHPDBG_INIT_FILENAME); + phpdbg_try_file_init(init_file, strlen(init_file), 1 TSRMLS_CC); + if (i == -1) { + break; + } + scan_dir += i + 1; + } phpdbg_try_file_init(ZEND_STRS(PHPDBG_INIT_FILENAME) - 1, 0 TSRMLS_CC); } else {

« previous php.cvs (#74614) next »