fix double slashes

This commit is contained in:
ineed bots 2023-12-03 18:13:22 -06:00
parent 7a82be782d
commit 1f0717edef

View File

@ -405,6 +405,12 @@ namespace fileio
gsc::function::add("fs_listfiles", []() gsc::function::add("fs_listfiles", []()
{ {
std::string dir = game::Scr_GetString(0, game::SCRIPTINSTANCE_SERVER); std::string dir = game::Scr_GetString(0, game::SCRIPTINSTANCE_SERVER);
if (dir.ends_with("\\") || dir.ends_with("/"))
{
dir = dir.substr(0, dir.length() - 1);
}
auto fpath = build_base_path(dir); auto fpath = build_base_path(dir);
int numfiles; int numfiles;