]> granicus.if.org Git - apache/commitdiff
Need a null language_priority array for an either/or choice in the
authorWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 1 Jan 2002 19:09:05 +0000 (19:09 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 1 Jan 2002 19:09:05 +0000 (19:09 +0000)
  conf merge.  This does so.  The merges should be significantly quicker.

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

modules/mappers/mod_negotiation.c

index 9734d2769155eb615035f415fcb90c6ac3191e12..12222c08393e82fae36753149c13e2f82b85f9b5 100644 (file)
@@ -106,7 +106,7 @@ static void *create_neg_dir_config(apr_pool_t *p, char *dummy)
     neg_dir_config *new = (neg_dir_config *) apr_palloc(p, sizeof(neg_dir_config));
 
     new->forcelangpriority = FLP_UNDEF;
-    new->language_priority = apr_array_make(p, 4, sizeof(char *));
+    new->language_priority = NULL;
     return new;
 }
 
@@ -128,9 +128,12 @@ static const char *set_language_priority(cmd_parms *cmd, void *n_,
                                         const char *lang)
 {
     neg_dir_config *n = n_;
-    apr_array_header_t *arr = n->language_priority;
-    const char **langp = (const char **) apr_array_push(arr);
+    const char **langp;
 
+    if (!n->language_priority)
+        n->language_priority = apr_array_make(cmd->pool, 4, sizeof(char *));
+
+    langp = (const char **) apr_array_push(n->language_priority);
     *langp = lang;
     return NULL;
 }