Update file_system.cc
This commit is contained in:
parent
7581d2a338
commit
ffe19213d1
@ -308,8 +308,8 @@ StringPiece FileSystem::Basename(StringPiece path) const {
|
|||||||
StringPiece FileSystem::Extension(StringPiece path) const {
|
StringPiece FileSystem::Extension(StringPiece path) const {
|
||||||
StringPiece basename = this->Basename(path);
|
StringPiece basename = this->Basename(path);
|
||||||
|
|
||||||
int pos = basename.rfind('.');
|
size_t pos = basename.rfind('.');
|
||||||
if (static_cast<size_t>(pos) == StringPiece::npos) {
|
if (pos == StringPiece::npos) {
|
||||||
return StringPiece(path.data() + path.size(), 0);
|
return StringPiece(path.data() + path.size(), 0);
|
||||||
} else {
|
} else {
|
||||||
return StringPiece(path.data() + pos + 1, path.size() - (pos + 1));
|
return StringPiece(path.data() + pos + 1, path.size() - (pos + 1));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user