From 1221a60d576f0be149b6afaa6ef9ba3ad0621acd Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 9 Jul 2011 05:41:03 +0400 Subject: [PATCH] [11725] Fixed chat command parse with explicit literal check. Before fix ExtractLiteralArg(str,"abc") reject "ab" string wrongly. --- src/game/Chat.cpp | 8 ++++++++ src/shared/revision_nr.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index b53ee643d..22f5cb062 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -2316,6 +2316,14 @@ char* ChatHandler::ExtractLiteralArg(char** args, char const* lit /*= NULL*/) if (lit) { int l = strlen(lit); + + int largs = 0; + while(head[largs] && !isWhiteSpace(head[largs])) + ++largs; + + if (largs < l) + l = largs; + int diff = strncmp(head, lit, l); if (diff != 0) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 173f973fe..e97c365d4 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11724" + #define REVISION_NR "11725" #endif // __REVISION_NR_H__