]> granicus.if.org Git - apache/commitdiff
Avoid unnecessariy initialisation before we test mod_info's handler name.
authorGraham Leggett <minfrin@apache.org>
Tue, 19 Oct 2010 23:26:30 +0000 (23:26 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 19 Oct 2010 23:26:30 +0000 (23:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024465 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/mod_info.c

index 9687fbf6de030c02dc16a2008622cb2318c7afb0..8baf722199675e54d9e4221b19421c77dbff54d5 100644 (file)
@@ -595,18 +595,18 @@ static int show_active_hooks(request_rec * r)
 
 static int display_info(request_rec * r)
 {
-    module *modp = NULL;
-    server_rec *serv = r->server;
+    module *modp;
     const char *more_info;
-    const command_rec *cmd = NULL;
-    int comma = 0;
+    const command_rec *cmd;
 
-    if (strcmp(r->handler, "server-info"))
+    if (strcmp(r->handler, "server-info")) {
         return DECLINED;
+    }
 
     r->allowed |= (AP_METHOD_BIT << M_GET);
-    if (r->method_number != M_GET)
+    if (r->method_number != M_GET) {
         return DECLINED;
+    }
 
     ap_set_content_type(r, "text/html; charset=ISO-8859-1");
 
@@ -657,6 +657,7 @@ static int display_info(request_rec * r)
             ap_rputs("</dl><hr />", r);
         }
         else {
+            int comma = 0;
             for (modp = ap_top_module; modp; modp = modp->next) {
                 if (!r->args || !strcasecmp(modp->name, r->args)) {
                     ap_rprintf(r,
@@ -742,7 +743,7 @@ static int display_info(request_rec * r)
                             ("<dt><strong>Module Directives:</strong> <tt>none</tt></dt>",
                              r);
                     }
-                    more_info = find_more_info(serv, modp->name);
+                    more_info = find_more_info(r->server, modp->name);
                     if (more_info) {
                         ap_rputs
                             ("<dt><strong>Additional Information:</strong>\n</dt><dd>",