- Fixed endless loop and segfault

This commit is contained in:
Felipe Pena 2008-09-12 17:30:53 +00:00
parent 4768abe05f
commit 9c9ee1a71c
3 changed files with 37 additions and 0 deletions

View file

@ -157,6 +157,11 @@ static void text_iter_cp_next(text_iter_obj* object, long flags TSRMLS_DC)
if (object->u.cp.offset == UBRK_DONE) {
return;
}
if (object->text == NULL) {
object->u.cp.offset = object->u.cp.cp_offset = UBRK_DONE;
return;
}
if (flags & ITER_REVERSE) {
U16_BACK_1(object->text, 0, object->u.cp.offset);