| Index: components/dom_distiller/core/page_features.cc
|
| diff --git a/components/dom_distiller/core/page_features.cc b/components/dom_distiller/core/page_features.cc
|
| index 8e7405212844ab841bc35dc07089b2993c6a6d66..fffe52d0dba082b11d555683eb22aa3eed2edff5 100644
|
| --- a/components/dom_distiller/core/page_features.cc
|
| +++ b/components/dom_distiller/core/page_features.cc
|
| @@ -24,7 +24,11 @@ std::string GetLastSegment(const std::string& path) {
|
| // return re.search('[^/]*\/?$', path).group(0)
|
| if (path.size() == 0)
|
| return "";
|
| - size_t start = path.rfind("/", path.size() - 1);
|
| + if (path.size() == 1) {
|
| + DCHECK(path[0] == '/');
|
| + return path;
|
| + }
|
| + size_t start = path.rfind("/", path.size() - 2);
|
| return start == std::string::npos ? "" : path.substr(start + 1);
|
| }
|
|
|
|
|