Index: chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc |
diff --git a/chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc b/chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc |
index 99fb5553bdc77320a7db080fe56d6bb3a2055b62..ac9d0d0581e26af57b37e233b5c7775045c09e98 100644 |
--- a/chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc |
+++ b/chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc |
@@ -148,10 +148,17 @@ SyncStatusCode GDataErrorCodeToSyncStatusCode( |
return SYNC_STATUS_FAILED; |
} |
-std::string RemovePrefix(const std::string& str, const std::string& prefix) { |
- if (StartsWithASCII(str, prefix, true)) |
- return std::string(str.begin() + prefix.size(), str.end()); |
- return str; |
+bool RemovePrefix(const std::string& str, const std::string& prefix, |
+ std::string* out) { |
+ if (!StartsWithASCII(str, prefix, true)) { |
+ if (out) |
+ *out = str; |
+ return false; |
+ } |
+ |
+ if (out) |
+ *out = str.substr(prefix.size()); |
+ return true; |
} |
} // namespace drive_backend |