]> git.kaiwu.me - nginx.git/commitdiff
Simplified code about duplicate root/alias directive.
authorRuslan Ermilov <ru@nginx.com>
Wed, 22 Mar 2017 20:36:35 +0000 (23:36 +0300)
committerRuslan Ermilov <ru@nginx.com>
Wed, 22 Mar 2017 20:36:35 +0000 (23:36 +0300)
src/http/ngx_http_core_module.c

index 1bd3ecd5cf11cacc1f5d680ae4c8a683b645b15f..c3957ba38764f5ca818683b0b16db26822ca73af 100644 (file)
@@ -4405,16 +4405,14 @@ ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     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;
     }