changeset 3458:bdcae1a576e3

compare long file names in case-insensitive mode, the bug had been introduced in r3418
author Igor Sysoev <igor@sysoev.ru>
date Wed, 03 Mar 2010 10:05:54 +0000
parents 17706823a57e
children 958f8de0c45f
files src/os/win32/ngx_files.c src/os/win32/ngx_win32_config.h src/os/win32/ngx_win32_init.c
diffstat 3 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/win32/ngx_files.c
+++ b/src/os/win32/ngx_files.c
@@ -48,7 +48,7 @@ ngx_open_file(u_char *name, u_long mode,
             goto failed;
         }
 
-        if (n != len - 1 || ngx_memcmp(u, lu, n) != 0) {
+        if (n != len - 1 || _wcsicmp(u, lu) != 0) {
             ngx_set_errno(NGX_ENOENT);
             goto failed;
         }
--- a/src/os/win32/ngx_win32_config.h
+++ b/src/os/win32/ngx_win32_config.h
@@ -36,6 +36,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <locale.h>
 
 #ifdef __WATCOMC__
 #define _TIME_T_DEFINED
--- a/src/os/win32/ngx_win32_init.c
+++ b/src/os/win32/ngx_win32_init.c
@@ -114,6 +114,9 @@ ngx_os_init(ngx_log_t *log)
 
     for (n = ngx_pagesize; n >>= 1; ngx_pagesize_shift++) { /* void */ }
 
+    /* delete default "C" locale for _wcsicmp() */
+    setlocale(LC_ALL, "");
+
 
     /* init Winsock */