summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 04b1feb)
raw | patch | inline | side by side (parent: 04b1feb)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 26 Jun 2010 00:01:07 +0000 (20:01 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 26 Jun 2010 00:01:51 +0000 (20:01 -0400) |
Thanks to Pierre Habouzit and Tobias Heinlein for reporting this.
NEWS | patch | blob | history | |
tig.c | patch | blob | history |
index 41729f7f13dd4fd4f503ae969d3b0d0915f20315..1a0960aa44a9f67370455c0d44048a4806370292 100644 (file)
--- a/NEWS
+++ b/NEWS
- Fix problem with empty diff views when file specs were passed on the
command line.
+ - Fix segfault when starting tig in pager mode.
tig-0.16
--------
index 5f4c2635c3a719c5ea06d01bc08be62b042802a5..ae335183f472645e08687af539be91ec2213fb36 100644 (file)
--- a/tig.c
+++ b/tig.c
VIEW_(BLAME, "blame", &blame_ops, TRUE, ref_commit),
VIEW_(BRANCH, "branch", &branch_ops, TRUE, ref_head),
VIEW_(HELP, "help", &help_ops, FALSE, ""),
- VIEW_(PAGER, "pager", &pager_ops, FALSE, "stdin"),
+ VIEW_(PAGER, "pager", &pager_ops, FALSE, ""),
VIEW_(STATUS, "status", &status_ops, TRUE, ""),
VIEW_(STAGE, "stage", &stage_ops, TRUE, ""),
};
break;
case REQ_VIEW_PAGER:
+ if (view == NULL) {
+ if (!io_open(&VIEW(REQ_VIEW_PAGER)->io, ""))
+ die("Failed to open stdin");
+ open_view(view, request, OPEN_PREPARED);
+ break;
+ }
+
if (!VIEW(REQ_VIEW_PAGER)->pipe && !VIEW(REQ_VIEW_PAGER)->lines) {
report("No pager content, press %s to run command from prompt",
get_key(view->keymap, REQ_PROMPT));
const char **filter_argv = NULL;
int i;
- if (!isatty(STDIN_FILENO)) {
- io_open(&VIEW(REQ_VIEW_PAGER)->io, "");
+ if (!isatty(STDIN_FILENO))
return REQ_VIEW_PAGER;
- }
if (argc <= 1)
return REQ_VIEW_MAIN;