Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Unified Diff: base/files/file_enumerator_win.cc

Issue 20610004: Base: FileEnumerator should not follow reparse points. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Skip test for XP Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_enumerator_win.cc
diff --git a/base/files/file_enumerator_win.cc b/base/files/file_enumerator_win.cc
index 64c98455ce505d5f7fd46be4c1188efd0c0b639c..e47f5421a711b7ef1dea22cc0590cceb578216ab 100644
--- a/base/files/file_enumerator_win.cc
+++ b/base/files/file_enumerator_win.cc
@@ -133,8 +133,10 @@ FilePath FileEnumerator::Next() {
if (recursive_) {
// If |cur_file| is a directory, and we are doing recursive searching,
// add it to pending_paths_ so we scan it after we finish scanning this
- // directory.
- pending_paths_.push(cur_file);
+ // directory. However, don't do recursion through reparse points or we
+ // may end up with an infinite cycle.
+ if (!(find_data_.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT))
+ pending_paths_.push(cur_file);
}
if (file_type_ & FileEnumerator::DIRECTORIES)
return cur_file;
« no previous file with comments | « base/file_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698