diff options
author | Garrett Serack <garretts@php.net> | 2009-10-09 19:43:00 +0000 |
---|---|---|
committer | Garrett Serack <garretts@php.net> | 2009-10-09 19:43:00 +0000 |
commit | 8e5a00e546da89c6a7340754483ab749086f5e01 (patch) | |
tree | 564a727d6aad4d94e064543bc5ab368dbec1bbd1 /main/php_ini.c | |
parent | 8a22597b651941526fe1777aca8d21229589c8e6 (diff) | |
download | php-git-8e5a00e546da89c6a7340754483ab749086f5e01.tar.gz |
- changed ini file directives [PATH=](on Win32) and [HOST=](on all) to be case insensitive (garretts)
Diffstat (limited to 'main/php_ini.c')
-rw-r--r-- | main/php_ini.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/main/php_ini.c b/main/php_ini.c index af96196ae8..6c889f2ed4 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -41,6 +41,20 @@ #define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) #endif +#ifdef PHP_WIN32 +#define TRANSLATE_SLASHES(path) \ + { \ + char *tmp = path; \ + while (*tmp) { \ + if (*tmp == '\\') *tmp = '/'; \ + tmp++; \ + } \ + } +#else +#define TRANSLATE_SLASHES(path) +#endif + + typedef struct _php_extension_lists { zend_llist engine; zend_llist functions; @@ -273,6 +287,12 @@ static void php_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_t key_len = Z_STRLEN_P(arg1) - sizeof("PATH") + 1; is_special_section = 1; has_per_dir_config = 1; +#ifdef PHP_WIN32 + // make the path lowercase on Windows, for case insensitivty. + strlwr(key); + + TRANSLATE_SLASHES(key); +#endif /* HOST sections */ } else if (!strncasecmp(Z_STRVAL_P(arg1), "HOST", sizeof("HOST") - 1)) { @@ -281,6 +301,7 @@ static void php_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_t key_len = Z_STRLEN_P(arg1) - sizeof("HOST") + 1; is_special_section = 1; has_per_host_config = 1; + strlwr(key); // host names are case-insensitive. } else { is_special_section = 0; |