From 9073dc99634285edc3b4886467871c14100f8233 Mon Sep 17 00:00:00 2001 From: volzhs Date: Fri, 3 Jun 2016 03:39:37 +0900 Subject: change invalid characters when get user data dir on Windows & Unix Can't create user data folder when project name has ``\ / : * ? " < > |`` characters on OS_Windows & OS_Unix. So, change it to ``-`` to be able to make folder. fixes #4928 and it's altanative to #4986. --- core/os/os.cpp | 9 +++++++++ core/os/os.h | 1 + 2 files changed, 10 insertions(+) (limited to 'core') diff --git a/core/os/os.cpp b/core/os/os.cpp index 6910b368d3..4daf41e68e 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -306,6 +306,15 @@ String OS::get_system_dir(SystemDir p_dir) const { return "."; } +String OS::get_safe_application_name() const { + String an = Globals::get_singleton()->get("application/name"); + Vector invalid_char = String("\\ / : * ? \" < > |").split(" "); + for (int i=0;i