diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2015-09-27 17:19:17 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2015-09-27 17:19:52 -0700 |
commit | 11376ae25bfdc90aa60511597163984e43700c22 (patch) | |
tree | 5840f672bce8e9eaa7309e6b4cadc4b13f04be7a /src/wildcard.cpp | |
parent | dd245f62f0f30403961cd71abe8730ea51ab1855 (diff) |
Fix for recursive wildcard expansion ignoring directories
When ascending out of a directory, we need to clear the directory
from the visited set. Fixes #2414.
Diffstat (limited to 'src/wildcard.cpp')
-rw-r--r-- | src/wildcard.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wildcard.cpp b/src/wildcard.cpp index ad8c8be6..78b38a2d 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -841,6 +841,9 @@ void wildcard_expander_t::expand_intermediate_segment(const wcstring &base_dir, /* We made it through. Perform normal wildcard expansion on this new directory, starting at our tail_wc, which includes the ANY_STRING_RECURSIVE guy. */ full_path.push_back(L'/'); this->expand(full_path, wc_remainder); + + /* Now remove the visited file. This is for #2414: only directories "beneath" us should be considered visited. */ + this->visited_files.erase(file_id); } } @@ -1024,7 +1027,7 @@ void wildcard_expander_t::expand(const wcstring &base_dir, const wchar_t *wc) } else { - /* Not the last segment, nonempty wildcard */ + /* Not the last segment, nonempty wldcard */ assert(next_slash != NULL); const wchar_t *wc_remainder = next_slash; while (*wc_remainder == L'/') |