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

Side by Side Diff: runtime/bin/directory_win.cc

Issue 10381150: Fix directory listing to actually have the semantics intended. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Windows part Created 8 years, 7 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 | « runtime/bin/directory_posix.cc ('k') | tests/standalone/io/file_system_links_test.dart » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/directory.h" 5 #include "bin/directory.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 9
10 #include "bin/platform.h" 10 #include "bin/platform.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 free(path); 158 free(path);
159 return false; 159 return false;
160 } 160 }
161 161
162 bool success = HandleEntry(&find_file_data, 162 bool success = HandleEntry(&find_file_data,
163 path, 163 path,
164 path_length, 164 path_length,
165 recursive, 165 recursive,
166 listing); 166 listing);
167 167
168 while ((FindNextFile(find_handle, &find_file_data) != 0) && success) { 168 while ((FindNextFile(find_handle, &find_file_data) != 0)) {
169 success = success && HandleEntry(&find_file_data, 169 success = HandleEntry(&find_file_data,
170 path, 170 path,
171 path_length, 171 path_length,
172 recursive, 172 recursive,
173 listing); 173 listing) && success;
174 } 174 }
175 175
176 if (GetLastError() != ERROR_NO_MORE_FILES) { 176 if (GetLastError() != ERROR_NO_MORE_FILES) {
177 success = false; 177 success = false;
178 PostError(listing, dir_name); 178 PostError(listing, dir_name);
179 } 179 }
180 180
181 if (FindClose(find_handle) == 0) { 181 if (FindClose(find_handle) == 0) {
182 success = false; 182 success = false;
183 PostError(listing, dir_name); 183 PostError(listing, dir_name);
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 } 375 }
376 376
377 377
378 bool Directory::Delete(const char* dir_name, bool recursive) { 378 bool Directory::Delete(const char* dir_name, bool recursive) {
379 if (!recursive) { 379 if (!recursive) {
380 return (RemoveDirectory(dir_name) != 0); 380 return (RemoveDirectory(dir_name) != 0);
381 } else { 381 } else {
382 return DeleteRecursively(dir_name); 382 return DeleteRecursively(dir_name);
383 } 383 }
384 } 384 }
OLDNEW
« no previous file with comments | « runtime/bin/directory_posix.cc ('k') | tests/standalone/io/file_system_links_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698