From 1f0717edefb04dcb4f687f85ce3c7aebb498038d Mon Sep 17 00:00:00 2001 From: ineed bots Date: Sun, 3 Dec 2023 18:13:22 -0600 Subject: [PATCH] fix double slashes --- src/component/fileio.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/component/fileio.cpp b/src/component/fileio.cpp index f0fb69f..bf1f73c 100644 --- a/src/component/fileio.cpp +++ b/src/component/fileio.cpp @@ -405,6 +405,12 @@ namespace fileio gsc::function::add("fs_listfiles", []() { 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); int numfiles;