Code

460b98870dc4792bd2a87aa1845e09479bfb814f
[pkg-tig.git] / debian / patches / quoted-config-opts-fix.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## quoted-config-opts-fix.dpatch by Sebastian Harl <sh@tokkee.org>
3 ##
4 ## DP: Fix handling of quoted strings in the config file
5 ## DP:
6 ## DP: parse_string() adapts the string length to automatically remove quotation
7 ## DP: marks when copying the string. However, when calling string_ncopy_do()
8 ## DP: strlen(arg) used to be called again instead of using the adapted value.
9 ## DP:
10 ## DP: This e.g. led to wrong locale settings when using
11 ## DP:   set commit-encoding = "UTF-8"
12 ## DP: and thus a slightly messed up display.
13 ## DP:
14 ## DP: Thanks to Gerfried Fuchs for reporting this.
16 diff a/tig.c b/tig.c
17 --- a/tig.c
18 +++ b/tig.c
19 @@ -1519,7 +1519,7 @@ option_set_command(int argc, const char *argv[])
20                         }
21                         arg += 1; arglen -= 2;
22                 default:
23 -                       string_ncopy(opt_encoding, arg, strlen(arg));
24 +                       string_ncopy(opt_encoding, arg, arglen);
25                         return OK;
26                 }
27         }