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

Unified Diff: ios/web/navigation/navigation_item_impl.mm

Issue 2876053002: Fixed NavigationItemImpl::GetDisplayTitleForURL for 'file://' URL. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | ios/web/navigation/navigation_item_impl_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/navigation_item_impl.mm
diff --git a/ios/web/navigation/navigation_item_impl.mm b/ios/web/navigation/navigation_item_impl.mm
index 0b8aff9c295645f8c31b392fdb5cccc9f4d56d25..89273479169964979b58d49259a9403d35ba2e44 100644
--- a/ios/web/navigation/navigation_item_impl.mm
+++ b/ios/web/navigation/navigation_item_impl.mm
@@ -297,7 +297,7 @@ base::string16 NavigationItemImpl::GetDisplayTitleForURL(const GURL& url) {
// For file:// URLs use the filename as the title, not the full path.
if (url.SchemeIsFile()) {
base::string16::size_type slashpos = title.rfind('/');
- if (slashpos != base::string16::npos)
+ if (slashpos != base::string16::npos && slashpos != (title.size() - 1))
title = title.substr(slashpos + 1);
}
« no previous file with comments | « no previous file | ios/web/navigation/navigation_item_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698