Просмотр исходного кода

ExtractTar: Allow an empty decompressor program

This allows for uncompressed tar files, as the decompressor process will
not get interposed in-between the file descriptors.
Guillem Jover лет назад: 12
Родитель
Сommit
3255db2d02
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      apt-inst/contrib/extracttar.cc

+ 6 - 0
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"));