Merge pull request #8 from krisztianloki/master
Fix for 'Not interpreted format conversions' accepted.
This commit is contained in:
@ -1364,13 +1364,15 @@ normal_format:
|
|||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (commandIndex[i] >= ' ') i++;
|
while (commandIndex[i] >= ' ') i++;
|
||||||
error("%s: Input \"%s%s\" mismatch after %ld byte%s\n",
|
error("%s: Input \"%s%s\" mismatch after %ld byte%s: %c != %c\n",
|
||||||
name(),
|
name(),
|
||||||
consumedInput > 10 ? "..." : "",
|
consumedInput > 10 ? "..." : "",
|
||||||
inputLine.expand(consumedInput > 10 ?
|
inputLine.expand(consumedInput > 10 ?
|
||||||
consumedInput-10 : 0,20)(),
|
consumedInput-10 : 0,20)(),
|
||||||
consumedInput,
|
consumedInput,
|
||||||
consumedInput==1 ? "" : "s");
|
consumedInput==1 ? "" : "s",
|
||||||
|
command,
|
||||||
|
inputLine[consumedInput]);
|
||||||
|
|
||||||
#ifndef NO_TEMPORARY
|
#ifndef NO_TEMPORARY
|
||||||
error("%s: got \"%s\" where \"%s\" was expected\n",
|
error("%s: got \"%s\" where \"%s\" was expected\n",
|
||||||
|
@ -1058,6 +1058,14 @@ compileNumber(unsigned long& number, const char*& source, unsigned long max)
|
|||||||
bool StreamProtocolParser::Protocol::
|
bool StreamProtocolParser::Protocol::
|
||||||
compileString(StreamBuffer& buffer, const char*& source,
|
compileString(StreamBuffer& buffer, const char*& source,
|
||||||
FormatType formatType, Client* client, int quoted)
|
FormatType formatType, Client* client, int quoted)
|
||||||
|
{
|
||||||
|
return compileStringInternal(buffer, source, formatType, client, quoted, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool StreamProtocolParser::Protocol::
|
||||||
|
compileStringInternal(StreamBuffer& buffer, const char*& source,
|
||||||
|
FormatType formatType, Client* client, int quoted, int recursionDepth)
|
||||||
{
|
{
|
||||||
bool escaped = false;
|
bool escaped = false;
|
||||||
int newline = 0;
|
int newline = 0;
|
||||||
@ -1085,7 +1093,7 @@ compileString(StreamBuffer& buffer, const char*& source,
|
|||||||
// compile all formats in this line
|
// compile all formats in this line
|
||||||
// We do this here after all variables in this line
|
// We do this here after all variables in this line
|
||||||
// have been replaced and after string has been coded.
|
// have been replaced and after string has been coded.
|
||||||
if (formatType != NoFormat)
|
if (recursionDepth == 0 && formatType != NoFormat)
|
||||||
{
|
{
|
||||||
int nformats=0;
|
int nformats=0;
|
||||||
char c;
|
char c;
|
||||||
@ -1250,7 +1258,7 @@ compileString(StreamBuffer& buffer, const char*& source,
|
|||||||
source += strlen(source)+1+sizeof(int);
|
source += strlen(source)+1+sizeof(int);
|
||||||
p = value();
|
p = value();
|
||||||
int saveline = line;
|
int saveline = line;
|
||||||
if (!compileString(buffer, p, formatType, client))
|
if (!compileStringInternal(buffer, p, formatType, client, false, recursionDepth + 1))
|
||||||
return false;
|
return false;
|
||||||
line = saveline;
|
line = saveline;
|
||||||
continue;
|
continue;
|
||||||
|
@ -59,6 +59,8 @@ public:
|
|||||||
bool compileCommands(StreamBuffer&, const char*& source, Client*);
|
bool compileCommands(StreamBuffer&, const char*& source, Client*);
|
||||||
bool replaceVariable(StreamBuffer&, const char* varname);
|
bool replaceVariable(StreamBuffer&, const char* varname);
|
||||||
const Variable* getVariable(const char* name);
|
const Variable* getVariable(const char* name);
|
||||||
|
bool compileStringInternal(StreamBuffer& buffer, const char*& source,
|
||||||
|
FormatType formatType, Client*, int quoted, int recursionDepth);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user