From eb03ea74588aa57fb224e85de50ff41ea63cf420 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Wed, 25 Jun 2008 14:56:14 +0000 Subject: refactor obscure code --- src/core/ngx_conf_file.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src') 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) { /* -- cgit v1.2.3