[11725] Fixed chat command parse with explicit literal check.

Before fix ExtractLiteralArg(str,"abc") reject "ab" string wrongly.
This commit is contained in:
VladimirMangos 2011-07-09 05:41:03 +04:00
parent 4ec136222a
commit 1221a60d57
2 changed files with 9 additions and 1 deletions

View file

@ -2316,6 +2316,14 @@ char* ChatHandler::ExtractLiteralArg(char** args, char const* lit /*= NULL*/)
if (lit) if (lit)
{ {
int l = strlen(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); int diff = strncmp(head, lit, l);
if (diff != 0) if (diff != 0)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11724" #define REVISION_NR "11725"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__