From: Jonas Fonseca Date: Sat, 22 Mar 2008 20:35:31 +0000 (+0100) Subject: Add hack to allow view loading to have multiple phases X-Git-Tag: tig-0.11~43 X-Git-Url: https://git.distorted.org.uk/~mdw/tig/commitdiff_plain/4ed67514df1103bfaeec3d549578e59cead74151?ds=inline Add hack to allow view loading to have multiple phases .. by avoiding end_update() call after last read line. --- diff --git a/tig.c b/tig.c index f8132fd..2551ba3 100644 --- a/tig.c +++ b/tig.c @@ -2234,8 +2234,8 @@ alloc_error: report("Allocation failure"); end: - view->ops->read(view, NULL); - end_update(view); + if (view->ops->read(view, NULL)) + end_update(view); return FALSE; } @@ -3077,6 +3077,8 @@ tree_read(struct view *view, char *text) enum line_type type; bool first_read = view->lines == 0; + if (!text) + return TRUE; if (textlen <= SIZEOF_TREE_ATTR) return FALSE;