We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e688cf2 commit 18620e2Copy full SHA for 18620e2
1 file changed
simplecpp.cpp
@@ -2720,11 +2720,11 @@ static std::string toAbsolutePath(const std::string& path) {
2720
}
2721
2722
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) {
+ const std::size_t lastSlash = path.find_last_of("\\/");
+ if (lastSlash == std::string::npos) {
2725
return "";
2726
2727
- return path.substr(0, firstSlash + (withTrailingSlash ? 1U : 0U));
+ return path.substr(0, lastSlash + (withTrailingSlash ? 1U : 0U));
2728
2729
2730
static std::string omitPathTrailingSlash(const std::string& path) {
0 commit comments