]> granicus.if.org Git - apache/commitdiff
move the assignment to the end of the loop.
authorEric Covener <covener@apache.org>
Wed, 12 Sep 2018 13:06:00 +0000 (13:06 +0000)
committerEric Covener <covener@apache.org>
Wed, 12 Sep 2018 13:06:00 +0000 (13:06 +0000)
This is more readable and isn't miscompiled w/ -O3 on a certain
unnamed EBCDIC platforms compiler.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1840678 13f79535-47bb-0310-9956-ffa450edef68

server/vhost.c

index 5b1d8742c5e63405f82a558cfff94fc2c5e57d2b..9dbd1691f33035d199a60d3f307296b69254fd0f 100644 (file)
@@ -1041,7 +1041,6 @@ static int update_server_from_aliases(request_rec *r)
                 goto found;
             }
         }
-        last_s = s;
 
         /* Fallback: does it match the virthost from the sar? */
         if (!strcasecmp(host, sar->virthost)) {
@@ -1050,6 +1049,8 @@ static int update_server_from_aliases(request_rec *r)
                 virthost_s = s;
             }
         }
+
+        last_s = s;
     }
 
     /* If ServerName and ServerAlias check failed, we end up here.  If it