diff --git a/source/shared_lib/include/platform/common/platform_common.h b/source/shared_lib/include/platform/common/platform_common.h index a6311eaa6..69e4d24e0 100644 --- a/source/shared_lib/include/platform/common/platform_common.h +++ b/source/shared_lib/include/platform/common/platform_common.h @@ -240,7 +240,8 @@ namespace Shared { bool StartsWith(const std::string &str, const std::string &key); bool EndsWith(const string &str, const string& key); - string endPathWithSlash(string &path, bool requireOSSlash = false); + string endPathWithSlash(string& path, bool requireOSSlash = false); + string endPathWithSlash(string&& path, bool requireOSSlash = false); string trimPathWithStartingSlash(string &path); string updatePathClimbingParts(string &path, bool processPreviousDirTokenCheck = true); string formatPath(string path); diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index 75c2e0b23..3c3293d8e 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -552,6 +552,19 @@ namespace Shared { return result; } + string endPathWithSlash(string&& path, bool requireOSSlash) { + if (EndsWith(path, "/") == false && EndsWith(path, "\\") == false) { + string seperator = "/"; + if (requireOSSlash == true) { +#if defined(WIN32) + seperator = "\\"; +#endif + } + path += seperator; + } + return path; + } + string endPathWithSlash(string &path, bool requireOSSlash) { if (EndsWith(path, "/") == false && EndsWith(path, "\\") == false) { string seperator = "/"; diff --git a/source/shared_lib/sources/platform/sdl/gl_wrap.cpp b/source/shared_lib/sources/platform/sdl/gl_wrap.cpp index 00210524e..d55df571e 100644 --- a/source/shared_lib/sources/platform/sdl/gl_wrap.cpp +++ b/source/shared_lib/sources/platform/sdl/gl_wrap.cpp @@ -225,7 +225,7 @@ namespace Shared { SDL_SetRelativeMouseMode(SDL_FALSE); SDL_SetRelativeMouseMode(SDL_TRUE); } - + #ifndef WIN32 string icon_file = ""; #if defined(DATADIR)