diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ngx_conf_file.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index b32f0f03c..dbeb39d0c 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -145,24 +145,28 @@ ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename) } if (rc == NGX_CONF_BLOCK_DONE) { + if (!block) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "unexpected \"}\""); goto failed; } - block = 0; + goto done; } - if (rc == NGX_CONF_FILE_DONE && block) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "unexpected end of file, expecting \"}\""); - goto failed; - } + if (rc == NGX_CONF_FILE_DONE) { + + if (block) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "unexpected end of file, expecting \"}\""); + goto failed; + } - if (rc != NGX_OK && rc != NGX_CONF_BLOCK_START) { goto done; } + /* rc == NGX_OK || rc == NGX_CONF_BLOCK_START */ + if (cf->handler) { /* |