diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-01-20 14:19:26 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-01-20 15:05:38 +0100 |
| commit | 21dcbfe451be24786ac8f22e022cda07d17413d5 (patch) | |
| tree | b9775ef961d89b8bd1418305e06785bbc98391a1 /text.c | |
| parent | 53f84f7cbafcb177406f8f7bcc890e626e72ca63 (diff) | |
| download | vis-21dcbfe451be24786ac8f22e022cda07d17413d5.tar.gz vis-21dcbfe451be24786ac8f22e022cda07d17413d5.tar.xz | |
text: fix EOF handling for text_iterator_byte_next
Handle zero length pieces gracefully. At some point
we should write a comprehensive set of unit tests
for the iterator API.
Diffstat (limited to 'text.c')
| -rw-r--r-- | text.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1392,7 +1392,7 @@ bool text_iterator_byte_next(Iterator *it, char *b) { return false; it->text++; /* special case for advancement to EOF */ - if (it->text == it->end && !it->piece->next->text) { + if (it->pos+1 == it->piece->text->size) { it->pos++; if (b) *b = '\0'; |
