Chromium Code Reviews

Unified Diff: chrome/installer/util/delete_after_reboot_helper.cc

Issue 5354006: Fix a problem with the delete-after-reboot code. Removing pending renames of ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: chrome/installer/util/delete_after_reboot_helper.cc
===================================================================
--- chrome/installer/util/delete_after_reboot_helper.cc (revision 67529)
+++ chrome/installer/util/delete_after_reboot_helper.cc (working copy)
@@ -244,6 +244,13 @@
DWORD length = GetShortPathName(path, WriteInto(&short_path, MAX_PATH),
MAX_PATH);
DLOG_IF(WARNING, length == 0) << __FUNCTION__ << " gle=" << GetLastError();
+ if (length == 0) {
+ // GetShortPathName fails if the path is no longer present. Instead of
+ // returning an empty string, just return the original string. This will
+ // serve for our purposes.
+ return path;
+ }
+
short_path.resize(length);
return short_path;
}
« no previous file with comments | « chrome/installer/util/delete_after_reboot_helper.h ('k') | chrome/installer/util/delete_after_reboot_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine