Code

5a01ff756d0be1f5d539e356cefd4ae4de649b10
[pkg-tig.git] / debian / patches / non-utf8-fix.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## non-utf8-fix.dpatch by Jonas Fonseca <fonseca@diku.dk>
3 ##
4 ## DP: Fix regression in handling of data for non-UTF-8 locales
5 ## DP:
6 ## DP: The bug was introduced in 65498141015b6070cf5c9b5704039389dba76e90 where
7 ## DP: the the IO API was changed from using stdio to 'raw' file descriptors.
8 ## DP: Part of the change removed the need for cutting the ending newline from
9 ## DP: the input line in update_view(). This caused the resulting iconv output
10 ## DP: buffer to not be NUL terminated since the input string no longer
11 ## DP: contained an ending NULL byte.
12 ## DP:
13 ## DP: Reported by Pavel Roskin.
15 diff a/tig.c b/tig.c
16 --- a/tig.c
17 +++ b/tig.c
18 @@ -2707,7 +2707,7 @@ update_view(struct view *view)
19  
20                 if (opt_iconv != ICONV_NONE) {
21                         ICONV_CONST char *inbuf = line;
22 -                       size_t inlen = linelen;
23 +                       size_t inlen = linelen + 1;
24  
25                         char *outbuf = out_buffer;
26                         size_t outlen = sizeof(out_buffer);