[nginx] Simplified code about duplicate root/alias directive.

Ruslan Ermilov ru at nginx.com
Thu Mar 23 15:29:48 UTC 2017


details:   http://hg.nginx.org/nginx/rev/6e20a6479325
branches:  
changeset: 6941:6e20a6479325
user:      Ruslan Ermilov <ru at nginx.com>
date:      Wed Mar 22 23:36:35 2017 +0300
description:
Simplified code about duplicate root/alias directive.

diffstat:

 src/http/ngx_http_core_module.c |  14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diffs (26 lines):

diff -r 39ff6939266e -r 6e20a6479325 src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c	Wed Mar 22 22:49:52 2017 +0300
+++ b/src/http/ngx_http_core_module.c	Wed Mar 22 23:36:35 2017 +0300
@@ -4405,16 +4405,14 @@ ngx_http_core_root(ngx_conf_t *cf, ngx_c
     if (clcf->root.data) {
 
         if ((clcf->alias != 0) == alias) {
-            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                               "\"%V\" directive is duplicate",
-                               &cmd->name);
-        } else {
-            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                               "\"%V\" directive is duplicate, "
-                               "\"%s\" directive was specified earlier",
-                               &cmd->name, clcf->alias ? "alias" : "root");
+            return "is duplicate";
         }
 
+        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                           "\"%V\" directive is duplicate, "
+                           "\"%s\" directive was specified earlier",
+                           &cmd->name, clcf->alias ? "alias" : "root");
+
         return NGX_CONF_ERROR;
     }
 


More information about the nginx-devel mailing list