any line that would not have been included before has length == 0
if (it->current.end >= it->end)
return EINA_FALSE;
- if (it->current.index == 0)
- it->current.index++;
match = *it->current.end;
+ if (it->current.index > 0)
+ it->current.end++;
while ((*it->current.end == '\n' || *it->current.end == '\r')
&& it->current.end < it->end)
{
if (match == *it->current.end)
- it->current.index++;
+ break;
it->current.end++;
}
+ it->current.index++;
if (it->current.end == it->end)
return EINA_FALSE;
Eina_Iterator *it;
Eina_File_Line *ln;
void *map;
- const unsigned int check[] = { 1, 2, 3, 6, 7 };
- int i = 0;
+ unsigned int i = 0;
eina_init();
it = eina_file_map_lines(f);
EINA_ITERATOR_FOREACH(it, ln)
{
- fail_if(ln->index != check[i]);
i++;
+ fail_if(ln->index != i);
+
+ if (i == 4 || i == 5)
+ fail_if(ln->length != 0);
}
fail_if(eina_iterator_container_get(it) != f);
eina_iterator_free(it);
- fail_if(i != 5);
+ fail_if(i != 7);
eina_file_close(f);