mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 01:59:19 +02:00
Revert substr_path function
This commit is contained in:
@@ -394,9 +394,7 @@ void replace_slashes(std::string &Filename)
|
|||||||
// returns potential path part from provided file name
|
// returns potential path part from provided file name
|
||||||
std::string_view substr_path(std::string const &Filename)
|
std::string_view substr_path(std::string const &Filename)
|
||||||
{
|
{
|
||||||
if (auto pos = Filename.rfind('/'); pos != std::string::npos)
|
return (Filename.rfind('/') != std::string::npos ? Filename.substr(0, Filename.rfind('/') + 1) : "");
|
||||||
return Filename.substr(0, pos + 1);
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns length of common prefix between two provided strings
|
// returns length of common prefix between two provided strings
|
||||||
|
|||||||
Reference in New Issue
Block a user