Commit 0e75717d authored by unknown's avatar unknown

fixed config parser to recognize correctly strings like following:

test="\"#no comment here"#real comment

parent 331ff0d8
......@@ -449,11 +449,12 @@ static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
static char *remove_end_comment(char *ptr)
{
char quote= 0;
char quote= 0; /* we are inside quote marks */
char escape= 0; /* symbol is protected by escape chagacter */
for (; *ptr; ptr++)
{
if (*ptr == '\'' || *ptr == '\"')
if ((*ptr == '\'' || *ptr == '\"') && !escape)
{
if (!quote)
quote= *ptr;
......@@ -465,6 +466,7 @@ static char *remove_end_comment(char *ptr)
*ptr= 0;
return ptr;
}
escape= (quote && *ptr == '\\' && !escape);
}
return ptr;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment