Code

debian/patches: Added non-utf8-fix.dpatch
authorSebastian Harl <sh@tokkee.org>
Tue, 3 Feb 2009 09:34:52 +0000 (10:34 +0100)
committerSebastian Harl <sh@tokkee.org>
Tue, 3 Feb 2009 09:38:39 +0000 (10:38 +0100)
Upstream patch fixing a regression in the handling of non-UTF-8 locales.

debian/changelog
debian/control
debian/patches/00list [new file with mode: 0644]
debian/patches/non-utf8-fix.dpatch [new file with mode: 0755]
debian/rules

index 98fc8e539c660bfc5aa875f32a0d5e9553ef8298..a4d4ea085317aca803c9e8c7d5890d9caa1ff37b 100644 (file)
@@ -2,8 +2,11 @@ tig (0.13-1) experimental; urgency=low
 
   * New upstream release (Closes: #513727).
   * debian/copyright: Use © instead of (C) to make lintian happy.
+  * debian/patches:
+    - Added non-utf8-fix.dpatch - upstream patch fixing a regression in the
+      handling of non-UTF-8 locales.
 
- -- Sebastian Harl <sh@tokkee.org>  Mon, 02 Feb 2009 12:21:46 +0100
+ -- Sebastian Harl <sh@tokkee.org>  Tue, 03 Feb 2009 10:33:22 +0100
 
 tig (0.12.1-1) experimental; urgency=low
 
index fc15c5bdc14a61ced6849b85e255233723f2f717..d186b6e30daa1741a8a5bcf002115856220a9bac 100644 (file)
@@ -2,7 +2,7 @@ Source: tig
 Section: utils
 Priority: optional
 Maintainer: Sebastian Harl <sh@tokkee.org>
-Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.14.6), git-core, libncursesw5-dev, asciidoc (>= 7), xmlto, docbook-utils
+Build-Depends: debhelper (>= 5), dpatch, dpkg-dev (>= 1.14.6), git-core, libncursesw5-dev, asciidoc (>= 7), xmlto, docbook-utils
 Standards-Version: 3.8.0
 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..0c853cf
--- /dev/null
@@ -0,0 +1,2 @@
+non-utf8-fix.dpatch
+
diff --git a/debian/patches/non-utf8-fix.dpatch b/debian/patches/non-utf8-fix.dpatch
new file mode 100755 (executable)
index 0000000..5a01ff7
--- /dev/null
@@ -0,0 +1,26 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## non-utf8-fix.dpatch by Jonas Fonseca <fonseca@diku.dk>
+##
+## DP: Fix regression in handling of data for non-UTF-8 locales
+## DP:
+## DP: The bug was introduced in 65498141015b6070cf5c9b5704039389dba76e90 where
+## DP: the the IO API was changed from using stdio to 'raw' file descriptors.
+## DP: Part of the change removed the need for cutting the ending newline from
+## DP: the input line in update_view(). This caused the resulting iconv output
+## DP: buffer to not be NUL terminated since the input string no longer
+## DP: contained an ending NULL byte.
+## DP:
+## DP: Reported by Pavel Roskin.
+
+diff a/tig.c b/tig.c
+--- a/tig.c
++++ b/tig.c
+@@ -2707,7 +2707,7 @@ update_view(struct view *view)
+               if (opt_iconv != ICONV_NONE) {
+                       ICONV_CONST char *inbuf = line;
+-                      size_t inlen = linelen;
++                      size_t inlen = linelen + 1;
+                       char *outbuf = out_buffer;
+                       size_t outlen = sizeof(out_buffer);
index 92ff9293e6e83db9f794134ea7219f4507e91bb8..a2784d22642f1c1d3c3b9649cfe6be25ccdaf6d6 100755 (executable)
@@ -19,6 +19,8 @@ else
        CFLAGS += -O2
 endif
 
+include /usr/share/dpatch/dpatch.make
+
 config.status: configure
        dh_testdir
        ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
@@ -27,14 +29,14 @@ config.status: configure
 
 build: build-stamp
 
-build-stamp: config.status
+build-stamp: config.status $(DPATCH_STAMPFN)
        dh_testdir
        
        $(MAKE) all doc
        
        touch build-stamp
 
-clean:
+clean: unpatch
        dh_testdir
        dh_testroot
        rm -f build-stamp