diff src/os/unix/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 acd51b0f6fd4
children f1dfe7ff4511
line wrap: on
line diff
--- a/src/os/unix/ngx_files.h
+++ b/src/os/unix/ngx_files.h
@@ -192,17 +192,6 @@ ngx_int_t ngx_create_file_mapping(ngx_fi
 void ngx_close_file_mapping(ngx_file_mapping_t *fm);
 
 
-#if (NGX_HAVE_CASELESS_FILESYSTEM)
-
-#define ngx_filename_cmp(s1, s2, n)  strncasecmp((char *) s1, (char *) s2, n)
-
-#else
-
-#define ngx_filename_cmp         ngx_memcmp
-
-#endif
-
-
 #define ngx_realpath(p, r)       (u_char *) realpath((char *) p, (char *) r)
 #define ngx_realpath_n           "realpath()"
 #define ngx_getcwd(buf, size)    (getcwd((char *) buf, size) != NULL)