Forráskód Böngészése

* scripts/controllib.pl (parsechangelog): Only binmode CDATA from the
parent side of the opened pipe, on the child side binmode STDOUT.

Guillem Jover 19 éve
szülő
commit
a146038aef
2 módosított fájl, 12 hozzáadás és 4 törlés
  1. 5 0
      ChangeLog
  2. 7 4
      scripts/controllib.pl

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2007-03-13  Guillem Jover  <guillem@debian.org>
+
+	* scripts/controllib.pl (parsechangelog): Only binmode CDATA from the
+	parent side of the opened pipe, on the child side binmode STDOUT.
+
 2007-03-13  Guillem Jover  <guillem@debian.org>
 
 	* scripts/dpkg-shlibdeps.pl: Use new style file handler references.

+ 7 - 4
scripts/controllib.pl

@@ -311,16 +311,19 @@ sub parsechangelog {
     my ($changelogfile, $changelogformat, $since) = @_;
 
     defined($c=open(CDATA,"-|")) || &syserr(_g("fork for parse changelog"));
-    binmode(CDATA);
-    if (!$c) {
+    if ($c) {
+	binmode(CDATA);
+	parsecdata(\*CDATA, 'L', 0, _g("parsed version of changelog"));
+	close(CDATA);
+	$? && subprocerr(_g("parse changelog"));
+    } else {
+	binmode(STDOUT);
         @al=($parsechangelog);
         push(@al,"-l$changelogfile");
         push(@al, "-F$changelogformat") if defined($changelogformat);
         push(@al, "-v$since") if defined($since);
         exec(@al) || &syserr("exec parsechangelog $parsechangelog");
     }
-    parsecdata(\*CDATA, 'L', 0, _g("parsed version of changelog"));
-    close(CDATA); $? && &subprocerr(_g("parse changelog"));
 }
 
 sub init_substvars