Mercurial > hg > nginx
changeset 2064:0835142149d2
refactor obscure code
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 25 Jun 2008 14:56:14 +0000 |
parents | 67a29af877ed |
children | 520cb18b64fb |
files | src/core/ngx_conf_file.c |
diffstat | 1 files changed, 12 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_conf_file.c Mon Jun 23 13:35:34 2008 +0000 +++ b/src/core/ngx_conf_file.c Wed Jun 25 14:56:14 2008 +0000 @@ -145,23 +145,27 @@ } 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; + } + + goto done; } - if (rc != NGX_OK && rc != NGX_CONF_BLOCK_START) { - goto done; - } + /* rc == NGX_OK || rc == NGX_CONF_BLOCK_START */ if (cf->handler) {