diff --git a/m-array.h b/m-array.h index d8456c6b..2ea78670 100644 --- a/m-array.h +++ b/m-array.h @@ -755,6 +755,7 @@ { \ assert (it != NULL && a == it->array); \ M_C(name, _push_at)(a, it->index + 1, x); \ + it->index ++; \ } \ , /* End of INIT_SET */ ) \ \ diff --git a/m-i-list.h b/m-i-list.h index cd7f60db..5c6c756d 100644 --- a/m-i-list.h +++ b/m-i-list.h @@ -481,6 +481,7 @@ typedef struct ilist_head_s { M_CALL_INIT_SET(oplist, *p, x); \ type *obj = M_C(name, _ref)(it); \ M_C(name, _push_after)(obj, p); \ + it->current = p; \ (void) list; \ ILISTI_CONTRACT(name, list); \ } \ diff --git a/m-list.h b/m-list.h index c4dd9745..e3cbeb29 100644 --- a/m-list.h +++ b/m-list.h @@ -472,6 +472,8 @@ next->next = current->next; \ current->next = next; \ } \ + /* Update insertion_point to this element */ \ + insertion_point->current = next; \ LISTI_CONTRACT(list); \ } \ \