diff options
| author | Dan Engelbrecht <[email protected]> | 2025-04-22 16:28:08 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-04-22 16:28:08 +0200 |
| commit | 732a1cb1e78abbabaa0d926e9b1e58a36538dc1b (patch) | |
| tree | 08d47d333f68e2f99ec7ec922fa72dea4ee96dbc /src/zenserver/config/luaconfig.cpp | |
| parent | xmake updatefrontend (diff) | |
| download | zen-732a1cb1e78abbabaa0d926e9b1e58a36538dc1b.tar.xz zen-732a1cb1e78abbabaa0d926e9b1e58a36538dc1b.zip | |
add cxxopts overload for parsing file paths from command line (#362)
Diffstat (limited to 'src/zenserver/config/luaconfig.cpp')
| -rw-r--r-- | src/zenserver/config/luaconfig.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/zenserver/config/luaconfig.cpp b/src/zenserver/config/luaconfig.cpp index f742fa34a..2c54de29e 100644 --- a/src/zenserver/config/luaconfig.cpp +++ b/src/zenserver/config/luaconfig.cpp @@ -4,27 +4,6 @@ namespace zen::LuaConfig { -std::string -MakeSafePath(const std::string_view Path) -{ -#if ZEN_PLATFORM_WINDOWS - if (Path.empty()) - { - return std::string(Path); - } - - std::string FixedPath(Path); - std::replace(FixedPath.begin(), FixedPath.end(), '/', '\\'); - if (!FixedPath.starts_with("\\\\?\\")) - { - FixedPath.insert(0, "\\\\?\\"); - } - return FixedPath; -#else - return std::string(Path); -#endif -}; - void EscapeBackslash(std::string& InOutString) { @@ -101,7 +80,7 @@ FilePathOption::Parse(sol::object Object) std::string Str = Object.as<std::string>(); if (!Str.empty()) { - Value = MakeSafePath(Str); + Value = MakeSafeAbsolutePath(Str); } } |