aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_file.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2018-12-24 21:07:05 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2018-12-24 21:07:05 +0300
commitaa741f87273f2137d9a52080593c5fe6f1d1b0ea (patch)
tree910786fc8f33014c148afcce1246214d3f1317e2 /src/core/ngx_file.c
parent499bb2655ee16e4659d571b413b1ea54fd19dcd1 (diff)
downloadnginx-aa741f87273f2137d9a52080593c5fe6f1d1b0ea.tar.gz
nginx-aa741f87273f2137d9a52080593c5fe6f1d1b0ea.zip
Win32: removed NGX_DIR_MASK concept.
Previous interface of ngx_open_dir() assumed that passed directory name has a room for NGX_DIR_MASK at the end (NGX_DIR_MASK_LEN bytes). While all direct users of ngx_dir_open() followed this interface, this also implied similar requirements for indirect uses - in particular, via ngx_walk_tree(). Currently none of ngx_walk_tree() uses provides appropriate space, and fixing this does not look like a right way to go. Instead, ngx_dir_open() interface was changed to not require any additional space and use appropriate allocations instead.
Diffstat (limited to 'src/core/ngx_file.c')
-rw-r--r--src/core/ngx_file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c
index 56780303b..63ada8557 100644
--- a/src/core/ngx_file.c
+++ b/src/core/ngx_file.c
@@ -1017,13 +1017,13 @@ ngx_walk_tree(ngx_tree_ctx_t *ctx, ngx_str_t *tree)
file.len = tree->len + 1 + len;
- if (file.len + NGX_DIR_MASK_LEN > buf.len) {
+ if (file.len > buf.len) {
if (buf.len) {
ngx_free(buf.data);
}
- buf.len = tree->len + 1 + len + NGX_DIR_MASK_LEN;
+ buf.len = tree->len + 1 + len;
buf.data = ngx_alloc(buf.len + 1, ctx->log);
if (buf.data == NULL) {