mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix deletePathFromFilename returning cutoff filenames (#15211)
This commit is contained in:
parent
bca44574d5
commit
c6fc694ea6
3 changed files with 7 additions and 9 deletions
|
@ -63,7 +63,7 @@ inline io::path &getFileNameExtension(io::path &dest, const io::path &source)
|
|||
}
|
||||
|
||||
//! delete path from filename
|
||||
inline io::path &deletePathFromFilename(io::path &filename)
|
||||
inline io::path deletePathFromFilename(const io::path &filename)
|
||||
{
|
||||
// delete path from filename
|
||||
const fschar_t *s = filename.c_str();
|
||||
|
@ -73,11 +73,10 @@ inline io::path &deletePathFromFilename(io::path &filename)
|
|||
while (*p != '/' && *p != '\\' && p != s)
|
||||
p--;
|
||||
|
||||
if (p != s) {
|
||||
if (p != s)
|
||||
++p;
|
||||
filename = p;
|
||||
}
|
||||
return filename;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
//! trim paths
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue