| Index: runtime/bin/directory_win.cc
|
| ===================================================================
|
| --- runtime/bin/directory_win.cc (revision 24116)
|
| +++ runtime/bin/directory_win.cc (working copy)
|
| @@ -20,7 +20,7 @@
|
| namespace bin {
|
|
|
| PathBuffer::PathBuffer() : length_(0) {
|
| - data_ = new wchar_t[MAX_PATH + 1];
|
| + data_ = calloc(PATH_MAX + 1, sizeof(wchar_t)); // NOLINT
|
| }
|
|
|
| char* PathBuffer::AsString() const {
|
| @@ -214,6 +214,17 @@
|
| }
|
|
|
|
|
| +void DirectoryListingEntry::ResetLink() {
|
| + if (link_ != NULL && (parent_ == NULL || parent_->link_ != link_)) {
|
| + delete link_;
|
| + link_ = NULL;
|
| + }
|
| + if (parent_ != NULL) {
|
| + link_ = parent_->link_;
|
| + }
|
| +}
|
| +
|
| +
|
| static bool DeleteFile(wchar_t* file_name, PathBuffer* path) {
|
| if (!path->AddW(file_name)) return false;
|
|
|
|
|