diff --git a/core/os/os.cpp b/core/os/os.cpp index 6910b368d34..4daf41e68e8 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;iget("application/name"); + String an = get_safe_application_name(); if (an!="") { diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 4f2bfd46ae1..aff48c718c5 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2243,7 +2243,7 @@ String OS_Windows::get_system_dir(SystemDir p_dir) const { } String OS_Windows::get_data_dir() const { - String an = Globals::get_singleton()->get("application/name"); + String an = get_safe_application_name(); if (an!="") { if (has_environment("APPDATA")) {