diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp index 992a0bc6d..d0e0f39cb 100644 --- a/src/engine/shared/console.cpp +++ b/src/engine/shared/console.cpp @@ -548,7 +548,9 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientID, bo } else if(Stroke) { - if(!m_pfnUnknownCommandCallback(Result.m_pCommand, m_pUnknownCommandUserdata)) + // Pass the original string to the unknown command callback instead of the parsed command, as the latter + // ends at the first whitespace, which breaks for unknown commands (filenames) containing spaces. + if(!m_pfnUnknownCommandCallback(pStr, m_pUnknownCommandUserdata)) { char aBuf[256]; str_format(aBuf, sizeof(aBuf), "No such command: %s.", Result.m_pCommand);