mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix unknown command handler for filenames containing spaces
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. Closes #5902.
This commit is contained in:
parent
7f8408eebc
commit
9d1f393c55
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue