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 basename = this->Basename(path);
|
||||
|
||||
int pos = basename.rfind('.');
|
||||
if (static_cast<size_t>(pos) == StringPiece::npos) {
|
||||
size_t pos = basename.rfind('.');
|
||||
if (pos == StringPiece::npos) {
|
||||
return StringPiece(path.data() + path.size(), 0);
|
||||
} else {
|
||||
return StringPiece(path.data() + pos + 1, path.size() - (pos + 1));
|
||||
|
Loading…
Reference in New Issue
Block a user