Skip to content

Commit d6799ea

Browse files
author
Swagtoy
committed
Fix p == s returning empty string
1 parent fb54bf9 commit d6799ea

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

irr/include/coreutil.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ inline io::path &getFileNameExtension(io::path &dest, const io::path &source)
6565
//! delete path from filename
6666
inline io::path deletePathFromFilename(const io::path &filename)
6767
{
68-
io::path res;
6968
// delete path from filename
7069
const fschar_t *s = filename.c_str();
7170
const fschar_t *p = s + filename.size();
@@ -74,11 +73,10 @@ inline io::path deletePathFromFilename(const io::path &filename)
7473
while (*p != '/' && *p != '\\' && p != s)
7574
p--;
7675

77-
if (p != s) {
76+
if (p != s)
7877
++p;
79-
res = p;
80-
}
81-
return res;
78+
79+
return p;
8280
}
8381

8482
//! trim paths

0 commit comments

Comments
 (0)