From b64c5b75c8471be59d0083a75cfd4bd8df90bdbf Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Mon, 18 Jun 2007 16:09:59 +0200 Subject: [PATCH] Fix pager mode regressions This fixes both a segfault when starting tig in pager mode, caused by no view being setup before calling report(). Introduced in: "Add notice about empty pager view" (5c4358d1b309381997a5c4780a432140fefa5bcb). Reported by Lars Noschinski in debian bug 429448. Also, a fix for actually reading from stdin, caused by comparison of view->vid and view->id being reported as equal leading to no actual update. Introduced in: "Improve management of view->ref and the title line" (035ba11f40c0a045989ed861e72327012af022b4). Now, the title line in pager mode will say "stdin" when reading from externally piped input. --- tig.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tig.c b/tig.c index 31b41f7..fa2a708 100644 --- a/tig.c +++ b/tig.c @@ -1289,8 +1289,8 @@ static struct view views[] = { VIEW_(LOG, "log", &pager_ops, ref_head), VIEW_(TREE, "tree", &tree_ops, ref_commit), VIEW_(BLOB, "blob", &blob_ops, ref_blob), - VIEW_(HELP, "help", &help_ops, ""), - VIEW_(PAGER, "pager", &pager_ops, ""), + VIEW_(HELP, "help", &help_ops, ""), + VIEW_(PAGER, "pager", &pager_ops, "stdin"), VIEW_(STATUS, "status", &status_ops, ""), }; @@ -2152,7 +2152,7 @@ view_driver(struct view *view, enum request request) break; case REQ_VIEW_PAGER: - if (!VIEW(REQ_VIEW_PAGER)->lines) { + if (!opt_pipe && !VIEW(REQ_VIEW_PAGER)->lines) { report("No pager content, press %s to run command from prompt", get_key(REQ_PROMPT)); break; -- 2.11.0