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

Unified Diff: runtime/bin/directory_win.cc

Issue 23702037: Fix error handling when current working directory is deleted. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix type of _Directory._current Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/directory_patch.dart ('k') | sdk/lib/_internal/lib/io_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory_win.cc
diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc
index 22c7a3a7dc8d991bd43eefc19e0b9bfec8248b14..f5f77bd99dc568fb51a6b9087763e7c0217b8345 100644
--- a/runtime/bin/directory_win.cc
+++ b/runtime/bin/directory_win.cc
@@ -351,6 +351,7 @@ Directory::ExistsResult Directory::Exists(const char* dir_name) {
char* Directory::Current() {
int length = GetCurrentDirectoryW(0, NULL);
+ if (length == 0) return NULL;
wchar_t* current = new wchar_t[length + 1];
GetCurrentDirectoryW(length + 1, current);
char* result = StringUtils::WideToUtf8(current);
« no previous file with comments | « runtime/bin/directory_patch.dart ('k') | sdk/lib/_internal/lib/io_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698