Bug#161338: debconf w/ charset encoding support
Package: dpkg-dev
Version: 1.10.8
Severity: normal
On Wed, Sep 18, 2002 at 03:07:21PM +0200, Radovan Garabik wrote:
> P.S. apt-get source hylafax said:
> ...
> Fetched 1335kB in 21s (63.0kB/s)
> Malformed UTF-8 character (unexpected end of string) at /usr/bin/dpkg-source line 604, <GZIP> line 5804.
>
> the source otherwise unpacked well.
dpkg-source should use binmode() when processing arbitrary binary data.
This is unimportant (unless porting to Win32/Mac) but good style and
harmless with Perl 5.6; it's important with Perl 5.8 because I/O now
uses the :utf8 layer by default when the current locale's encoding is
UTF-8, so binary filehandles need to be identified as such.
Something like this should help:
--- dpkg-source.orig 2002-09-18 14:23:07.000000000 +0100
+++ dpkg-source 2002-09-18 14:22:35.000000000 +0100
@@ -1050,6 +1050,7 @@
sub forkgzipwrite {
open(GZIPFILE,"> $_[0]") || &syserr("create file $_[0]");
pipe(GZIPREAD,GZIP) || &syserr("pipe for gzip");
+ binmode(GZIP);
defined($cgz= fork) || &syserr("fork for gzip");
if (!$cgz) {
open(STDIN,"<&GZIPREAD") || &syserr("reopen gzip pipe"); close(GZIPREAD);
@@ -1064,6 +1065,7 @@
local $SIG{PIPE} = 'DEFAULT';
open(GZIPFILE,"< $_[0]") || &syserr("read file $_[0]");
pipe(GZIP,GZIPWRITE) || &syserr("pipe for gunzip");
+ binmode(GZIP);
defined($cgz= fork) || &syserr("fork for gunzip");
if (!$cgz) {
open(STDOUT,">&GZIPWRITE") || &syserr("reopen gunzip pipe"); close(GZIPWRITE);
--
Colin Watson [cjwatson@flatline.org.uk]
Reply to: