From da50f97e6fcf3842e1220e903a939dca4920411f Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Sun, 16 Feb 2014 23:29:13 +0100
Subject: [PATCH 1/3] ExtractTar: Allow an empty decompressor program
Status: applied

This allows for uncompressed tar files, as the decompressor process will
not get interposed in-between the file descriptors.
---
 apt-inst/contrib/extracttar.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc
index fb4db42..45da3b7 100644
--- a/apt-inst/contrib/extracttar.cc
+++ b/apt-inst/contrib/extracttar.cc
@@ -111,6 +111,12 @@ bool ExtractTar::Done(bool Force)
    gzip will efficiently ignore the extra bits. */
 bool ExtractTar::StartGzip()
 {
+   if (DecompressProg.empty())
+   {
+      InFd.OpenDescriptor(File.Fd(), FileFd::ReadOnly, FileFd::None, false);
+      return true;
+   }
+
    int Pipes[2];
    if (pipe(Pipes) != 0)
       return _error->Errno("pipe",_("Failed to create pipes"));
-- 
1.9.0.rc3.244.g3497008

