Skip to content

Commit

Permalink
fix(core/resource): fix 'escapeWindowPath'
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Nov 4, 2024
1 parent 20424ea commit 7f94e33
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/core/resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@
#include <fstream>
#endif

#if SOCKET_RUNTIME_PLATFORM_WINDOWS
static const String escapeWindowsPath (const Path& path) {
const auto dirname = path.remove_filename();
auto value = dirname.string();
size_t offset = 0;
// escape
while ((offset = value.find('\\', offset)) != String::npos) {
value.replace(offset, 1, "\\\\");
offset += 2;
}
return value
}
#endif

namespace SSC {
static std::map<String, FileResource::Cache> caches;
static Mutex mutex;
static FileResource::WellKnownPaths defaultWellKnownPaths;

#if SOCKET_RUNTIME_PLATFORM_WINDOWS
static const String escapeWindowsPath (const Path& path) {
const auto dirname = Path(path).remove_filename();
auto value = dirname.string();
size_t offset = 0;
// escape
while ((offset = value.find('\\', offset)) != String::npos) {
value.replace(offset, 1, "\\\\");
offset += 2;
}
return value;
}
#endif

#if SOCKET_RUNTIME_PLATFORM_ANDROID
static Android::AssetManager* sharedAndroidAssetManager = nullptr;
static Path externalAndroidStorageDirectory;
Expand Down

0 comments on commit 7f94e33

Please sign in to comment.