]> granicus.if.org Git - apache/commitdiff
Follow up to r1847430.
authorChristophe Jaillet <jailletc36@apache.org>
Sun, 10 Feb 2019 10:14:37 +0000 (10:14 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Sun, 10 Feb 2019 10:14:37 +0000 (10:14 +0000)
- These flags are not for apr_dir_ function. Clarify comment.
- Initialize 'depth', especially when AP_DIR_FLAG_RECURSIVE is explicitelly required.
- Avoid an harmless over-allocation .

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

include/httpd.h
server/config.c
server/util.c

index eab66b114be388f0529370f7c37018d378c15afe..9292c25a7eb9b4b430a8d2d13513c7fc0581fe9b 100644 (file)
@@ -2560,7 +2560,7 @@ AP_DECLARE(int) ap_cstr_casecmp(const char *s1, const char *s2);
 AP_DECLARE(int) ap_cstr_casecmpn(const char *s1, const char *s2, apr_size_t n);
 
 /**
- * Default flags for apr_dir_*().
+ * Default flags for ap_dir_*fnmatch().
  */
 #define AP_DIR_FLAG_NONE      0
 
index dcadba0c665fa8437f703d28b02fd53bcd12b413..13bc0922691e9d43b7112f1a7e77607a461e2b67 100644 (file)
@@ -1920,6 +1920,7 @@ AP_DECLARE(const char *) ap_process_fnmatch_configs(server_rec *s,
     w.flags = (optional ? AP_DIR_FLAG_OPTIONAL : AP_DIR_FLAG_NONE) | AP_DIR_FLAG_RECURSIVE;
     w.cb = process_resource_config_cb;
     w.ctx = &cfgs;
+    w.depth = 0;
 
     /* don't require conf/httpd.conf if we have a -C or -c switch */
     if ((ap_server_pre_read_config->nelts
index 691846d906589798790531665e012fa025f81e67..3693bfbff1535448e1820d221afb0ce2e1cc60fd 100644 (file)
@@ -3459,13 +3459,13 @@ static int fname_alphasort(const void *fn1, const void *fn2)
     const fnames *f1 = fn1;
     const fnames *f2 = fn2;
 
-    return strcmp(f1->fname,f2->fname);
+    return strcmp(f1->fname, f2->fname);
 }
 
 AP_DECLARE(ap_dir_match_t *)ap_dir_cfgmatch(cmd_parms *cmd, int flags,
         const char *(*cb)(ap_dir_match_t *w, const char *fname), void *ctx)
 {
-    ap_dir_match_t *w = apr_palloc(cmd->temp_pool, sizeof(cmd_parms));
+    ap_dir_match_t *w = apr_palloc(cmd->temp_pool, sizeof(*w));
 
     w->prefix = apr_pstrcat(cmd->pool, cmd->cmd->name, ": ", NULL);
     w->p = cmd->pool;