case insensitive file system location support provided by locale only
This commit is contained in:
parent
261287b0be
commit
16044c276a
3 changed files with 16 additions and 1 deletions
|
@ -1204,7 +1204,7 @@ ngx_http_core_find_static_location(ngx_http_request_t *r,
|
|||
|
||||
n = (len <= (size_t) node->len) ? len : node->len;
|
||||
|
||||
rc = ngx_memcmp(uri, node->name, n);
|
||||
rc = ngx_filename_cmp(uri, node->name, n);
|
||||
|
||||
if (rc != 0) {
|
||||
node = (rc < 0) ? node->left : node->right;
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
#ifdef __CYGWIN__
|
||||
|
||||
#define NGX_HAVE_CASELESS_FILESYSTEM 1
|
||||
|
||||
#define ngx_open_file(name, mode, create, access) \
|
||||
open((const char *) name, mode|create|O_BINARY, access)
|
||||
|
||||
|
@ -103,6 +105,16 @@ ngx_int_t ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s);
|
|||
#define ngx_file_uniq(sb) (sb)->st_ino
|
||||
|
||||
|
||||
#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_getcwd(buf, size) (getcwd(buf, size) != NULL)
|
||||
#define ngx_getcwd_n "getcwd()"
|
||||
|
|
|
@ -123,6 +123,9 @@ ngx_int_t ngx_file_info(u_char *filename, ngx_file_info_t *fi);
|
|||
- 116444736000000000) / 10000000)
|
||||
|
||||
|
||||
#define ngx_filename_cmp(s1, s2, n) strnicmp((char *) s1, (char *) s2, n)
|
||||
|
||||
|
||||
#define ngx_getcwd(buf, size) GetCurrentDirectory(size, buf)
|
||||
#define ngx_getcwd_n "GetCurrentDirectory()"
|
||||
#define NGX_MAX_PATH MAX_PATH
|
||||
|
|
Loading…
Reference in a new issue