- helpers: fix getBaseName() and getFileExt() for urls with query-strings

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2020-02-15 17:22:56 +01:00
committed by Thilo Graf
parent 5616fc79f7
commit cff41d02e4

View File

@@ -476,7 +476,9 @@ std::string getPathName(std::string &path)
std::string getBaseName(std::string &path)
{
return _getBaseName(path, "/");
std::string p = path;
p = _getPathName(p, "?");
return _getBaseName(p, "/");
}
std::string getFileName(std::string &file)
@@ -486,7 +488,9 @@ std::string getFileName(std::string &file)
std::string getFileExt(std::string &file)
{
return _getBaseName(file, ".");
std::string f = file;
f = _getPathName(f, "?");
return _getBaseName(f, ".");
}