]> git.kaiwu.me - nginx.git/commitdiff
Don't silently ignore the last line of configuration file that
authorRuslan Ermilov <ru@nginx.com>
Wed, 18 Apr 2012 13:30:43 +0000 (13:30 +0000)
committerRuslan Ermilov <ru@nginx.com>
Wed, 18 Apr 2012 13:30:43 +0000 (13:30 +0000)
consists solely of one unterminated token (inspired by #150).

src/core/ngx_conf_file.c

index bb39f42697bef8d96923720fe0c4225cf4187b07..892fa4719a83512c5a5831dcd09335472ce35a9e 100644 (file)
@@ -465,7 +465,7 @@ ngx_conf_read_token(ngx_conf_t *cf)
 
             if (cf->conf_file->file.offset >= file_size) {
 
-                if (cf->args->nelts > 0) {
+                if (cf->args->nelts > 0 || !last_space) {
 
                     if (cf->conf_file->file.fd == NGX_INVALID_FILE) {
                         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,