--- server/config.c (revision 680953) +++ server/config.c (working copy) @@ -1666,60 +1666,13 @@ 0); } else { - apr_dir_t *dirp; - apr_finfo_t dirent; int current; apr_array_header_t *candidates = NULL; fnames *fnew; apr_status_t rv; - char *path = apr_pstrdup(p, fname), *pattern = NULL; - - pattern = ap_strrchr(path, '/'); - - AP_DEBUG_ASSERT(pattern != NULL); /* path must be absolute. */ - - *pattern++ = '\0'; - - if (apr_fnmatch_test(path)) { - return apr_pstrcat(p, "Wildcard patterns not allowed in Include ", - fname, NULL); - } - - if (!ap_is_directory(p, path)){ - return apr_pstrcat(p, "Include directory '", path, "' not found", - NULL); - } - - if (!apr_fnmatch_test(pattern)) { - return apr_pstrcat(p, "Must include a wildcard pattern for " - "Include ", fname, NULL); - } - - /* - * first course of business is to grok all the directory - * entries here and store 'em away. Recall we need full pathnames - * for this. - */ - rv = apr_dir_open(&dirp, path, p); - if (rv != APR_SUCCESS) { - char errmsg[120]; - return apr_psprintf(p, "Could not open config directory %s: %s", - path, apr_strerror(rv, errmsg, sizeof errmsg)); - } - candidates = apr_array_make(p, 1, sizeof(fnames)); - while (apr_dir_read(&dirent, APR_FINFO_DIRENT, dirp) == APR_SUCCESS) { - /* strip out '.' and '..' */ - if (strcmp(dirent.name, ".") - && strcmp(dirent.name, "..") - && (apr_fnmatch(pattern, dirent.name, - APR_FNM_PERIOD) == APR_SUCCESS)) { - fnew = (fnames *) apr_array_push(candidates); - fnew->fname = ap_make_full_path(p, path, dirent.name); - } - } + apr_match_glob_path(fname, &candidates,p); - apr_dir_close(dirp); if (candidates->nelts != 0) { const char *error;