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-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4ed67514df1103bfaeec3d549578e59cead74151;p=tig.git 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;