From a6445adf61a87f73a3cd7781c36e36e228ac526e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 24 Jun 2019 01:59:01 +0300 Subject: Fix code style --- src/utils/stringutils.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/utils') diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 3af63f96e..99160905d 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -338,10 +338,11 @@ std::string getFileName(const std::string &path) { size_t pos1 = path.rfind('/'); const size_t pos2 = path.rfind('\\'); - if (pos1 == std::string::npos) - pos1 = pos2; - else if (pos2 != std::string::npos && pos2 > pos1) + if (pos1 == std::string::npos || + (pos2 != std::string::npos && pos2 > pos1)) + { pos1 = pos2; + } if (pos1 == std::string::npos) return path; @@ -352,10 +353,11 @@ std::string getFileDir(const std::string &path) { size_t pos1 = path.rfind('/'); const size_t pos2 = path.rfind('\\'); - if (pos1 == std::string::npos) - pos1 = pos2; - else if (pos2 != std::string::npos && pos2 > pos1) + if (pos1 == std::string::npos || + (pos2 != std::string::npos && pos2 > pos1)) + { pos1 = pos2; + } if (pos1 == std::string::npos) return path; -- cgit v1.2.3-60-g2f50