[Scummvm-git-logs] scummvm master -> 234dc99fd3c3d0358e4247a8ac86e4c832ca7994
ccawley2011
noreply at scummvm.org
Wed Dec 4 22:41:17 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
234dc99fd3 RISCOS: Don't encode path when it's not needed
Commit: 234dc99fd3c3d0358e4247a8ac86e4c832ca7994
https://github.com/scummvm/scummvm/commit/234dc99fd3c3d0358e4247a8ac86e4c832ca7994
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2024-12-04T22:41:14Z
Commit Message:
RISCOS: Don't encode path when it's not needed
Also disable atomic support as it may fail to write when file names are
long.
Changed paths:
backends/fs/stdiostream.cpp
common/path.cpp
diff --git a/backends/fs/stdiostream.cpp b/backends/fs/stdiostream.cpp
index cc03e78321c..db2cb7bd60b 100644
--- a/backends/fs/stdiostream.cpp
+++ b/backends/fs/stdiostream.cpp
@@ -43,6 +43,10 @@
// Atari file names must have a 8.3 format, atomic breaks this
#define STDIOSTREAM_NO_ATOMIC_SUPPORT
#endif
+#if defined(RISCOS)
+// RISC OS file names are expected to be 10 characters or less, atomic makes this hard to guarantee
+#define STDIOSTREAM_NO_ATOMIC_SUPPORT
+#endif
StdioStream::StdioStream(void *handle) : _handle(handle), _path(nullptr) {
assert(handle);
diff --git a/common/path.cpp b/common/path.cpp
index 5b413e3dcbb..65e451fea65 100644
--- a/common/path.cpp
+++ b/common/path.cpp
@@ -1177,13 +1177,21 @@ String Path::toConfig() const {
return toString(Path::kNativeSeparator);
}
}
-#elif defined(__3DS__) || defined(__amigaos4__) || defined(__DS__) || defined(__MORPHOS__) || defined(NINTENDO_SWITCH) || defined(__PSP__) || defined(PSP2) || defined(__WII__) || defined(WIN32)
+#elif defined(__3DS__) || defined(__amigaos4__) || defined(__DS__) || defined(__MORPHOS__) || defined(NINTENDO_SWITCH) || defined(__PSP__) || defined(PSP2) || defined(RISCOS) || defined(__WII__) || defined(WIN32)
// For all platforms making use of : as a drive separator, avoid useless punycoding
if (!isEscaped()) {
// If we are escaped, we have forbidden characters which must be encoded
// Try to replace all : by SEPARATOR and check if we need puny encoding: if we don't, we are safe
Path tmp(*this);
tmp._str.replace(':', SEPARATOR);
+#if defined(RISCOS)
+ // RiscOS uses these characters everywhere
+ tmp._str.replace('$', SEPARATOR);
+ tmp._str.replace('<', SEPARATOR);
+ tmp._str.replace('>', SEPARATOR);
+ // We can get ending dots when we replace $ (.$ suffix)
+ tmp._str.replace('.', SEPARATOR);
+#endif
#if defined(WIN32)
// WIN32 can also make use of ? in Win32 devices namespace
tmp._str.replace('?', SEPARATOR);
More information about the Scummvm-git-logs
mailing list