Skip to content

Commit 18620e2

Browse files
Tal500Tal Hadad
authored andcommitted
typo fix
1 parent e688cf2 commit 18620e2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

simplecpp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,11 +2720,11 @@ static std::string toAbsolutePath(const std::string& path) {
27202720
}
27212721

27222722
static std::string dirPath(const std::string& path, bool withTrailingSlash=true) {
2723-
const std::size_t firstSlash = path.find_last_of("\\/");
2724-
if (firstSlash == std::string::npos) {
2723+
const std::size_t lastSlash = path.find_last_of("\\/");
2724+
if (lastSlash == std::string::npos) {
27252725
return "";
27262726
}
2727-
return path.substr(0, firstSlash + (withTrailingSlash ? 1U : 0U));
2727+
return path.substr(0, lastSlash + (withTrailingSlash ? 1U : 0U));
27282728
}
27292729

27302730
static std::string omitPathTrailingSlash(const std::string& path) {

0 commit comments

Comments
 (0)