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

Side by Side Diff: base/file_util_win.cc

Issue 7157: Fix FileEnumerator (win) for non-recursive, directory-only enumerations.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/file_util_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_util.h" 5 #include "base/file_util.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 #include <time.h> 10 #include <time.h>
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 670
671 // Construct the absolute filename. 671 // Construct the absolute filename.
672 cur_file.insert(0, root_path_); 672 cur_file.insert(0, root_path_);
673 673
674 if (find_data_.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { 674 if (find_data_.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
675 if (recursive_) { 675 if (recursive_) {
676 // If |cur_file| is a directory, and we are doing recursive searching, add 676 // If |cur_file| is a directory, and we are doing recursive searching, add
677 // it to pending_paths_ so we scan it after we finish scanning this 677 // it to pending_paths_ so we scan it after we finish scanning this
678 // directory. 678 // directory.
679 pending_paths_.push(cur_file); 679 pending_paths_.push(cur_file);
680 return (file_type_ & FileEnumerator::DIRECTORIES) ? cur_file : Next();
681 } 680 }
682 681 return (file_type_ & FileEnumerator::DIRECTORIES) ? cur_file : Next();
683 if ((file_type_ & FileEnumerator::DIRECTORIES) == 0)
684 return Next();
685 } 682 }
686 return (file_type_ & FileEnumerator::FILES) ? cur_file : Next(); 683 return (file_type_ & FileEnumerator::FILES) ? cur_file : Next();
687 } 684 }
688 685
689 } // namespace file_util 686 } // namespace file_util
OLDNEW
« 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