isn't included as last block of a mtree file or
last line of a entry. A data returned by the
__archive_read_ahead function isn't always includeing
the character '\n' if following datas have it.
SVN-Revision: 607
{
ssize_t bytes_read;
ssize_t total_size = 0;
- ssize_t find_off;
+ ssize_t find_off = 0;
const void *t;
const char *s;
void *p;
}
memcpy(mtree->line.s + total_size, t, bytes_read);
__archive_read_consume(a, bytes_read);
- find_off = total_size;
total_size += bytes_read;
/* Null terminate. */
mtree->line.s[total_size] = '\0';
/* If we found an unescaped '\n', clean up and return. */
- if (p == NULL)
- continue;
for (u = mtree->line.s + find_off; *u; ++u) {
if (u[0] == '\n') {
*start = mtree->line.s;
memmove(u, u + 1,
total_size - (u - mtree->line.s) + 1);
--total_size;
+ ++u;
break;
}
+ if (u[1] == '\0')
+ break;
}
+ find_off = u - mtree->line.s;
}
}