Package: tig
Version: 0.16-1.1
Severity: important
Tags: patch squeeze sid

Hi!

tig segfaults when run as:

git show|tig

The patch, backported from upstream commit
5355b6ed446a22714d944c316f3c037348f67d76, is attached.

Thanks.

Kumar

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.36-rc1+ (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages tig depends on:
ii  git [git-core]            1:1.7.1-1.1    fast, scalable, distributed revisi
ii  git-core                  1:1.7.1-1.1    fast, scalable, distributed revisi
ii  libc6                     2.11.2-2       Embedded GNU C Library: Shared lib
ii  libncursesw5              5.7+20100313-2 shared libraries for terminal hand

tig recommends no packages.

tig suggests no packages.

-- no debconf information

-- 
To the guests that must go, bid God's speed and brush away all traces
of their steps.
- Rabindranath Tagore (The Gardener, 1915)
diff -Nru --exclude changelog tig-0.16/tig.c tig-0.16/tig.c
--- tig-0.16/tig.c	2010-06-12 10:38:54.000000000 -0500
+++ tig-0.16/tig.c	2010-08-26 21:54:20.000000000 -0500
@@ -2308,7 +2308,7 @@
 	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,  ""),
 };
@@ -3700,6 +3700,13 @@
 		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));
@@ -7729,10 +7736,8 @@
 	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;

Reply via email to