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

Unified Diff: chrome/browser/media_gallery/media_storage_util.cc

Issue 10872076: Fix MediaStorageUtil::CrackDeviceId function to include ":" in the media device type prefix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 8 years, 4 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
Index: chrome/browser/media_gallery/media_storage_util.cc
diff --git a/chrome/browser/media_gallery/media_storage_util.cc b/chrome/browser/media_gallery/media_storage_util.cc
index 2379d70d3d98b573ea9e08a7f0cf4e146143b1d4..0242690e94d55566d9d7f5e10caa066b36a7df39 100644
--- a/chrome/browser/media_gallery/media_storage_util.cc
+++ b/chrome/browser/media_gallery/media_storage_util.cc
@@ -101,7 +101,8 @@ std::string MediaStorageUtil::MakeDeviceId(Type type,
bool MediaStorageUtil::CrackDeviceId(const std::string& device_id,
Type* type, std::string* unique_id) {
size_t prefix_length = device_id.find_first_of(':');
- std::string prefix = device_id.substr(0, prefix_length);
+ std::string prefix = prefix_length != std::string::npos ?
+ device_id.substr(0, prefix_length + 1) : "";
Type found_type;
if (prefix == kUsbMassStorageWithDCIMPrefix) {

Powered by Google App Engine
This is Rietveld 408576698