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

Unified Diff: chrome/common/win_util.cc

Issue 79045: Fixes saving files that don't have valid extensions. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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
« chrome/common/win_util.h ('K') | « chrome/common/win_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/win_util.cc
===================================================================
--- chrome/common/win_util.cc (revision 13948)
+++ chrome/common/win_util.cc (working copy)
@@ -250,7 +250,12 @@
size_t first_separator_index = first_extension.find(L';');
if (first_separator_index != std::wstring::npos)
first_extension = first_extension.substr(0, first_separator_index);
- GetRegistryDescriptionFromExtension(first_extension, &desc);
+ if (!GetRegistryDescriptionFromExtension(first_extension, &desc)) {
+ // The extension doesn't exist in the registry. It's likely bogus, so
+ // just drop it.
+ include_all_files = true;
+ continue;
+ }
if (desc.empty())
desc = L"*." + first_extension;
}
« chrome/common/win_util.h ('K') | « chrome/common/win_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698