From 3123fbd6d445b298d895d0aa404fb593bab1286a Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 3 Sep 2010 21:16:21 +0200 Subject: [PATCH] patches: Added bts594549-pager-segfault. This is an upstream patch fixing a segfault when started in pager mode. Thanks to Kumar Appaiah for reporting this and pointing out the upstream fix! Closes: #594549 Also, build-depend on and use dpatch. --- debian/changelog | 11 +++++ debian/control | 2 +- debian/patches/00list | 2 + .../patches/bts594549-pager-segfault.dpatch | 47 +++++++++++++++++++ debian/rules | 6 ++- 5 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 debian/patches/00list create mode 100755 debian/patches/bts594549-pager-segfault.dpatch diff --git a/debian/changelog b/debian/changelog index c439c7d..2dc7bbd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +tig (0.16-2) unstable; urgency=low + + * debian/patches: + - Added bts594549-pager-segfault - upstream patch fixing a segfault when + started in pager mode; thanks to Kumar Appaiah for reporting this and + pointing out the upstream fix (Closes: #594549). + * debian/control, debian/rules: + - Build-depend on and use dpatch. + + -- Sebastian Harl Fri, 03 Sep 2010 21:15:21 +0200 + tig (0.16-1) unstable; urgency=low * New upstream release; thanks to Sedat Dilek for the pointer diff --git a/debian/control b/debian/control index e16f07a..76d76c3 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: tig Section: vcs Priority: optional Maintainer: Sebastian Harl -Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.14.6), libncursesw5-dev, asciidoc (>= 8.4), xmlto, docbook-utils +Build-Depends: debhelper (>= 5), dpatch, dpkg-dev (>= 1.14.6), libncursesw5-dev, asciidoc (>= 8.4), xmlto, docbook-utils Standards-Version: 3.8.4 Homepage: http://jonas.nitro.dk/tig/ Vcs-Git: git://git.tokkee.org/pkg-tig.git diff --git a/debian/patches/00list b/debian/patches/00list new file mode 100644 index 0000000..ce9434d --- /dev/null +++ b/debian/patches/00list @@ -0,0 +1,2 @@ +bts594549-pager-segfault.dpatch + diff --git a/debian/patches/bts594549-pager-segfault.dpatch b/debian/patches/bts594549-pager-segfault.dpatch new file mode 100755 index 0000000..a28d31a --- /dev/null +++ b/debian/patches/bts594549-pager-segfault.dpatch @@ -0,0 +1,47 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## bts594549-pager-segfault.dpatch by Jonas Fonseca +## +## DP: Fix segfault when starting tig in pager mode. +## DP: +## DP: (Upstream commit 5355b6ed446a22714d944c316f3c037348f67d76) + +@DPATCH@ + +diff a/tig.c b/tig.c +--- a/tig.c ++++ b/tig.c +@@ -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; diff --git a/debian/rules b/debian/rules index 9666fa1..969f53d 100755 --- a/debian/rules +++ b/debian/rules @@ -19,7 +19,9 @@ else CFLAGS += -O2 endif -config.status: configure +include /usr/share/dpatch/dpatch.make + +config.status: configure $(DPATCH_STAMPFN) dh_testdir ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc \ @@ -34,7 +36,7 @@ build-stamp: config.status touch build-stamp -clean: +clean: unpatch dh_testdir dh_testroot rm -f build-stamp -- 2.30.2