summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/paths.cpp4
-rw-r--r--src/utils/paths.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/paths.cpp b/src/utils/paths.cpp
index c00a3f39d..228276efd 100644
--- a/src/utils/paths.cpp
+++ b/src/utils/paths.cpp
@@ -85,9 +85,7 @@ std::string removeLast(std::string str)
if (pos2 == std::string::npos || pos3 > pos2)
pos2 = pos3;
}
- if (pos2 == std::string::npos)
- pos2 = -1;
- if (pos2 >= 0)
+ if (pos2 != std::string::npos)
return str.substr(0, pos2);
else
return str;
diff --git a/src/utils/paths.h b/src/utils/paths.h
index 18fa4629e..ba87ab961 100644
--- a/src/utils/paths.h
+++ b/src/utils/paths.h
@@ -31,6 +31,8 @@ bool checkPath(std::string path);
std::string &fixDirSeparators(std::string &str);
+std::string removeLast(std::string str);
+
std::string getSelfName();
#endif // UTILS_PATHS_H