summaryrefslogtreecommitdiffstats
path: root/core/os/os.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/os/os.cpp')
-rw-r--r--core/os/os.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp
index fa7f23ded0..642de11a9f 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -247,7 +247,10 @@ String OS::get_safe_dir_name(const String &p_dir_name, bool p_allow_paths) const
for (int i = 0; i < invalid_chars.size(); i++) {
safe_dir_name = safe_dir_name.replace(invalid_chars[i], "-");
}
- return safe_dir_name;
+
+ // Trim trailing periods from the returned value as it's not valid for folder names on Windows.
+ // This check is still applied on non-Windows platforms so the returned value is consistent across platforms.
+ return safe_dir_name.rstrip(".");
}
// Path to data, config, cache, etc. OS-specific folders
@@ -513,6 +516,10 @@ bool OS::has_feature(const String &p_feature) {
if (p_feature == "threads") {
return true;
}
+#else
+ if (p_feature == "nothreads") {
+ return true;
+ }
#endif
if (_check_internal_feature_support(p_feature)) {