From aac64c17cd7dd8c6ceba5738cc27a7eee48b8e59 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Mon, 30 Oct 2006 03:01:17 +0100 Subject: [PATCH] Never split the tree view when opening another tree view Organization: Straylight/Edgeware From: Jonas Fonseca The resulting bogus display[] state ment that the blob view was not initialized causing segmentation faults in the redrawing code. Reported by Alexey Tourbin --- tig.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tig.c b/tig.c index fcfbc43..3b320e6 100644 --- a/tig.c +++ b/tig.c @@ -2580,7 +2580,7 @@ tree_read(struct view *view, char *text) static bool tree_enter(struct view *view, struct line *line) { - enum open_flags flags = display[0] == view ? OPEN_SPLIT : OPEN_DEFAULT; + enum open_flags flags; enum request request; switch (line->type) { @@ -2610,11 +2610,12 @@ tree_enter(struct view *view, struct line *line) /* Trees and subtrees share the same ID, so they are not not * unique like blobs. */ - flags |= OPEN_RELOAD; + flags = OPEN_RELOAD; request = REQ_VIEW_TREE; break; case LINE_TREE_FILE: + flags = display[0] == view ? OPEN_SPLIT : OPEN_DEFAULT; request = REQ_VIEW_BLOB; break; -- [mdw]