From 0759760856bd7d82b0a8f59ea266c92ff330d993 Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Thu, 18 Oct 2018 21:15:08 +0200 Subject: [PATCH] Enhanced error message on folder creation with invalid chars on Windows If the user tried to create folder with *, | or > in its name it would return a generic error "Could not create folder." Now the same message is shown when creating a folder with /, \\, :, *, |, > or ending with . or an empty space. --- editor/filesystem_dock.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 5d155c30141..b11c5c3bef5 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1217,7 +1217,8 @@ void FileSystemDock::_make_dir_confirm() { if (dir_name.length() == 0) { EditorNode::get_singleton()->show_warning(TTR("No name provided")); return; - } else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1 || dir_name.ends_with(".") || dir_name.ends_with(" ")) { + } else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1 || dir_name.find("*") != -1 || + dir_name.find("|") != -1 || dir_name.find(">") != -1 || dir_name.ends_with(".") || dir_name.ends_with(" ")) { EditorNode::get_singleton()->show_warning(TTR("Provided name contains invalid characters")); return; }