Code

patches: Added quoted-config-opts-fix.dpatch. tig-0.14-1
authorSebastian Harl <sh@tokkee.org>
Sat, 14 Feb 2009 13:00:11 +0000 (14:00 +0100)
committerSebastian Harl <sh@tokkee.org>
Sat, 14 Feb 2009 13:00:11 +0000 (14:00 +0100)
This backported upstream patch fixes the handling of quoted strings in the
config file.

debian/changelog
debian/patches/00list
debian/patches/quoted-config-opts-fix.dpatch [new file with mode: 0755]

index 6de48cc4937f48012f996b54d4d9685072a6bd51..7d71f31ef56564baad8276e994398f598d68b3a1 100644 (file)
@@ -5,10 +5,12 @@ tig (0.14-1) experimental; urgency=low
     - Removed non-utf8-fix.dpatch - included upstream.
     - Removed tigrc-parsing-fix.dpatch - included upstream.
     - Removed mem-corruption-fix.dpatch - included upstream.
-    - Added tigrc-example-fix.dpatch - fix error in examples for the set
-      command (Closes: #514990).
+    - Added tigrc-example-fix.dpatch - upstream patch fixing an error in
+      examples for the set command (Closes: #514990).
+    - Added quoted-config-opts-fix.dpatch - backported upstream patch fixing
+      the handling of quoted strings in the config file.
 
- -- Sebastian Harl <sh@tokkee.org>  Fri, 13 Feb 2009 10:55:30 +0100
+ -- Sebastian Harl <sh@tokkee.org>  Sat, 14 Feb 2009 13:59:03 +0100
 
 tig (0.13-1) experimental; urgency=low
 
index 835f66d09fed09f3f1905ec9679a9d8e035db8b7..20c4e5ac2bdadd61dd10291b73232b2aab63d4c4 100644 (file)
@@ -1,2 +1,3 @@
 tigrc-example-fix.dpatch
+quoted-config-opts-fix.dpatch
 
diff --git a/debian/patches/quoted-config-opts-fix.dpatch b/debian/patches/quoted-config-opts-fix.dpatch
new file mode 100755 (executable)
index 0000000..460b988
--- /dev/null
@@ -0,0 +1,27 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## quoted-config-opts-fix.dpatch by Sebastian Harl <sh@tokkee.org>
+##
+## DP: Fix handling of quoted strings in the config file
+## DP:
+## DP: parse_string() adapts the string length to automatically remove quotation
+## DP: marks when copying the string. However, when calling string_ncopy_do()
+## DP: strlen(arg) used to be called again instead of using the adapted value.
+## DP:
+## DP: This e.g. led to wrong locale settings when using
+## DP:   set commit-encoding = "UTF-8"
+## DP: and thus a slightly messed up display.
+## DP:
+## DP: Thanks to Gerfried Fuchs for reporting this.
+
+diff a/tig.c b/tig.c
+--- a/tig.c
++++ b/tig.c
+@@ -1519,7 +1519,7 @@ option_set_command(int argc, const char *argv[])
+                       }
+                       arg += 1; arglen -= 2;
+               default:
+-                      string_ncopy(opt_encoding, arg, strlen(arg));
++                      string_ncopy(opt_encoding, arg, arglen);
+                       return OK;
+               }
+       }