Adjust test to demonstrate failure, existing code only worked for
windows newlines on blank line.
@fix T2236
if (cr)
{
if (lf && lf < cr)
- return lf + 1;
- return cr + 1;
+ return lf;
+ return cr;
}
else if (lf)
- return lf + 1;
+ return lf;
start += chunk;
boundary = 4096;
if (it->current.end >= it->end)
return EINA_FALSE;
+ if (it->current.index == 0)
+ it->current.index++;
match = *it->current.end;
while ((*it->current.end == '\n' || *it->current.end == '\r')
it->current.index++;
it->current.end++;
}
- it->current.index++;
if (it->current.end == it->end)
return EINA_FALSE;
it->current.start = it->current.end;
it->current.end = eol;
- it->current.length = eol - it->current.start - 1;
+ it->current.length = eol - it->current.start;
*data = &it->current;
return EINA_TRUE;
END_TEST
static const char *virtual_file_data = "this\n"
- "is a test for the sake of testing\n"
+ "is a test for the sake of testing\r\n"
"it should detect all the line of this\n"
"\n"
"\r\n"