Code

patches: Added bts594549-pager-segfault.
authorSebastian Harl <sh@tokkee.org>
Fri, 3 Sep 2010 19:16:21 +0000 (21:16 +0200)
committerSebastian Harl <sh@tokkee.org>
Fri, 3 Sep 2010 19:16:21 +0000 (21:16 +0200)
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
debian/control
debian/patches/00list [new file with mode: 0644]
debian/patches/bts594549-pager-segfault.dpatch [new file with mode: 0755]
debian/rules

index c439c7d32a41ba41acaefde7ff373e16a25cfd0d..2dc7bbd07d7ee8b9bd0e525a3e6e0c17651cd577 100644 (file)
@@ -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 <tokkee@debian.org>  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
index e16f07ad4335bad48f4c8eb5e48416fec74b8ce2..76d76c3ff52516777a1a3eb198978e0ded61eabf 100644 (file)
@@ -2,7 +2,7 @@ Source: tig
 Section: vcs
 Priority: optional
 Maintainer: Sebastian Harl <tokkee@debian.org>
-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 (file)
index 0000000..ce9434d
--- /dev/null
@@ -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 (executable)
index 0000000..a28d31a
--- /dev/null
@@ -0,0 +1,47 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## bts594549-pager-segfault.dpatch by Jonas Fonseca <fonseca@diku.dk>
+##
+## 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;
index 9666fa17a574fa9d7d61f43abc33a848cc0e5f53..969f53ddfe8384586bdf58efcdf2e3eab1e0fccd 100755 (executable)
@@ -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