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

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

Issue 9428002: Fix bug from r4390 on Windows (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 | « no previous file | 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) 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 char* path, 67 char* path,
68 int path_length, 68 int path_length,
69 DirectoryListing* listing) { 69 DirectoryListing* listing) {
70 size_t written = snprintf(path + path_length, 70 size_t written = snprintf(path + path_length,
71 MAX_PATH - path_length, 71 MAX_PATH - path_length,
72 "%s", 72 "%s",
73 file_name); 73 file_name);
74 if (written != strlen(file_name)) { 74 if (written != strlen(file_name)) {
75 return false; 75 return false;
76 }; 76 };
77 return listing->HandleFile(file_name); 77 return listing->HandleFile(path);
78 } 78 }
79 79
80 80
81 static bool HandleEntry(LPWIN32_FIND_DATA find_file_data, 81 static bool HandleEntry(LPWIN32_FIND_DATA find_file_data,
82 char* path, 82 char* path,
83 int path_length, 83 int path_length,
84 bool recursive, 84 bool recursive,
85 DirectoryListing* listing) { 85 DirectoryListing* listing) {
86 DWORD attributes = find_file_data->dwFileAttributes; 86 DWORD attributes = find_file_data->dwFileAttributes;
87 if ((attributes & FILE_ATTRIBUTE_DIRECTORY) != 0) { 87 if ((attributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
(...skipping 307 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 | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698