summaryrefslogtreecommitdiff
path: root/strings/apr_fnmatch.c
diff options
context:
space:
mode:
authorrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2004-03-06 02:49:50 +0000
committerrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2004-03-06 02:49:50 +0000
commit888d23e5e099a0eafbaff882fc254d80a8b46c60 (patch)
tree554ad7cb060aeeb1bd78de0f8e959f6cf0c75184 /strings/apr_fnmatch.c
parenta51a39237632944ebfcdaa42f64d750e528441a5 (diff)
downloadlibapr-888d23e5e099a0eafbaff882fc254d80a8b46c60.tar.gz
Fix a bug in apr_match_glob. We need to strdup the filename, otherwise
each call to apr_dir_read will overwrite the previous name. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64937 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'strings/apr_fnmatch.c')
-rw-r--r--strings/apr_fnmatch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/strings/apr_fnmatch.c b/strings/apr_fnmatch.c
index 417ac8312..7c41ea658 100644
--- a/strings/apr_fnmatch.c
+++ b/strings/apr_fnmatch.c
@@ -285,7 +285,7 @@ APR_DECLARE(apr_status_t) apr_match_glob(const char *pattern,
while (apr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) {
if (apr_fnmatch(pattern, finfo.name, 0) == APR_SUCCESS) {
- *(const char **)apr_array_push(*result) = finfo.name;
+ *(const char **)apr_array_push(*result) = apr_pstrdup(p, finfo.name);
}
}
apr_dir_close(dir);