]> granicus.if.org Git - apache/commitdiff
Save a few bytes in conf pool when processing 'AllowOverrideList'.
authorChristophe Jaillet <jailletc36@apache.org>
Fri, 6 Nov 2015 21:10:57 +0000 (21:10 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Fri, 6 Nov 2015 21:10:57 +0000 (21:10 +0000)
The 'override_list' table is allocated from the cmd->pool, just as all strings from argv[].
So there is no need to duplicate them.

+ some minor style issues

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

server/core.c

index 5602e5730a27ba2304034d0dc14454c75559b56c..b3f622db601ffab15001627b49d30661d43495fe 100644 (file)
@@ -1805,7 +1805,7 @@ static const char *set_override_list(cmd_parms *cmd, void *d_, int argc, char *c
 
     d->override_list = apr_table_make(cmd->pool, argc);
 
-    for (i=0;i<argc;i++){
+    for (i = 0; i < argc; i++) {
         if (!strcasecmp(argv[i], "None")) {
             if (argc != 1) {
                 return "'None' not allowed with other directives in "
@@ -1816,6 +1816,7 @@ static const char *set_override_list(cmd_parms *cmd, void *d_, int argc, char *c
         else {
             const command_rec *result = NULL;
             module *mod = ap_top_module;
+
             result = ap_find_command_in_modules(argv[i], &mod);
             if (result == NULL) {
                 ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
@@ -1834,7 +1835,7 @@ static const char *set_override_list(cmd_parms *cmd, void *d_, int argc, char *c
                 continue;
             }
             else {
-                apr_table_set(d->override_list, argv[i], "1");
+                apr_table_setn(d->override_list, argv[i], "1");
             }
         }
     }