|
@@ -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
|