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

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

Issue 9452009: Fix bug in Directory after porting to using native ports (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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/src/DirectoryTest.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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 DirectoryListing* listing) { 46 DirectoryListing* listing) {
47 if (strcmp(dir_name, ".") != 0 && 47 if (strcmp(dir_name, ".") != 0 &&
48 strcmp(dir_name, "..") != 0) { 48 strcmp(dir_name, "..") != 0) {
49 size_t written = snprintf(path + path_length, 49 size_t written = snprintf(path + path_length,
50 MAX_PATH - path_length, 50 MAX_PATH - path_length,
51 "%s", 51 "%s",
52 dir_name); 52 dir_name);
53 if (written != strlen(dir_name)) { 53 if (written != strlen(dir_name)) {
54 return false; 54 return false;
55 } 55 }
56 bool ok = listing->HandleDirectory(dir_name); 56 bool ok = listing->HandleDirectory(path);
57 if (!ok) return ok; 57 if (!ok) return ok;
58 if (recursive) { 58 if (recursive) {
59 return ListRecursively(path, recursive, listing); 59 return ListRecursively(path, recursive, listing);
60 } 60 }
61 } 61 }
62 return true; 62 return true;
63 } 63 }
64 64
65 65
66 static bool HandleFile(char* file_name, 66 static bool HandleFile(char* file_name,
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 } 395 }
396 396
397 397
398 bool Directory::Delete(const char* dir_name, bool recursive) { 398 bool Directory::Delete(const char* dir_name, bool recursive) {
399 if (!recursive) { 399 if (!recursive) {
400 return (RemoveDirectory(dir_name) != 0); 400 return (RemoveDirectory(dir_name) != 0);
401 } else { 401 } else {
402 return DeleteRecursively(dir_name); 402 return DeleteRecursively(dir_name);
403 } 403 }
404 } 404 }
OLDNEW
« no previous file with comments | « runtime/bin/directory_posix.cc ('k') | tests/standalone/src/DirectoryTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698