From: William A. Rowe Jr Date: Tue, 1 Jan 2002 19:09:05 +0000 (+0000) Subject: Need a null language_priority array for an either/or choice in the X-Git-Tag: 2.0.30~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9fe3041915ad2a786cc5ef4ecbbf7c24b243013;p=apache Need a null language_priority array for an either/or choice in the 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 --- diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 9734d27691..12222c0839 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -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; }