- /*
- * 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_dir_close(dirp);
- if (candidates->nelts != 0) {
- const char *error;
-
- qsort((void *) candidates->elts, candidates->nelts,
- sizeof(fnames), fname_alphasort);
-
- /*
- * Now recurse these... we handle errors and subdirectories
- * via the recursion, which is nice
- */
- for (current = 0; current < candidates->nelts; ++current) {
- fnew = &((fnames *) candidates->elts)[current];
- error = process_resource_config_nofnmatch(s, fnew->fname,
- conftree, p,
- ptemp, 0);
- if (error) {
- return error;
- }
- }
- }