diff --git a/library/Core.cpp b/library/Core.cpp index dac776506..d206a7c62 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -460,6 +460,18 @@ command_result Core::runCommand(color_ostream &con, const std::string &first, ve { if (!first.empty()) { + // Disallow backslashes in commands (e.g. script names), for consistency + if(first.find('\\') != std::string::npos) + { + std::string suggestion = first; + for (size_t i = 0; i < suggestion.size(); i++) + { + if (suggestion[i] == '\\') + suggestion[i] = '/'; + } + con.printerr("Backslashes in command names are not valid. Use %s instead.\n", suggestion.c_str()); + return CR_NOT_IMPLEMENTED; + } // let's see what we actually got if(first=="help" || first == "?" || first == "man") {