comparison src/os/win32/ngx_files.h @ 5389:72e31d88defa

Added ngx_filename_cmp() with "/" sorted to the left. This patch fixes incorrect handling of auto redirect in configurations like: location /0 { } location /a- { } location /a/ { proxy_pass ... } With previously used sorting, this resulted in the following locations tree (as "-" is less than "/"): "/a-" "/0" "/a/" and a request to "/a" didn't match "/a/" with auto_redirect, as it didn't traverse relevant tree node during lookup (it tested "/a-", then "/0", and then falled back to null location). To preserve locale use for non-ASCII characters on case-insensetive systems, libc's tolower() used.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 23 Sep 2013 19:37:13 +0400
parents 13eb3193cd63
children a680bf4dddd5
comparison
equal deleted inserted replaced
5388:fbaae7d1c033 5389:72e31d88defa
170 170
171 ngx_int_t ngx_create_file_mapping(ngx_file_mapping_t *fm); 171 ngx_int_t ngx_create_file_mapping(ngx_file_mapping_t *fm);
172 void ngx_close_file_mapping(ngx_file_mapping_t *fm); 172 void ngx_close_file_mapping(ngx_file_mapping_t *fm);
173 173
174 174
175 #define NGX_HAVE_CASELESS_FILESYSTEM 1
176
177 #define ngx_filename_cmp(s1, s2, n) _strnicmp((char *) s1, (char *) s2, n)
178
179
180 u_char *ngx_realpath(u_char *path, u_char *resolved); 175 u_char *ngx_realpath(u_char *path, u_char *resolved);
181 #define ngx_realpath_n "" 176 #define ngx_realpath_n ""
182 #define ngx_getcwd(buf, size) GetCurrentDirectory(size, (char *) buf) 177 #define ngx_getcwd(buf, size) GetCurrentDirectory(size, (char *) buf)
183 #define ngx_getcwd_n "GetCurrentDirectory()" 178 #define ngx_getcwd_n "GetCurrentDirectory()"
184 #define ngx_path_separator(c) ((c) == '/' || (c) == '\\') 179 #define ngx_path_separator(c) ((c) == '/' || (c) == '\\')