From f50faa5a0bdf375ab678cec0a057e5bc8848b665 Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Wed, 5 Oct 2022 17:18:32 +0100 Subject: [PATCH] Ensure `IsTarfile` supports uncompressed files (close #121) --- deb/tarfile.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deb/tarfile.go b/deb/tarfile.go index a7be19a..6648122 100644 --- a/deb/tarfile.go +++ b/deb/tarfile.go @@ -94,14 +94,14 @@ func DecompressorFor(ext string) DecompressorFunc { // IsTarfile {{{ // Check to see if the given ArEntry is, in fact, a Tarfile. This method -// will return `true` for `control.tar.*` and `data.tar.*` files. +// will return `true` for files that have `.tar.*` or `.tar` suffix. // // This will return `false` for the `debian-binary` file. If this method // returns `true`, the `.Tarfile()` method will be around to give you a // tar.Reader back. func (e *ArEntry) IsTarfile() bool { ext := filepath.Ext(e.Name) - return filepath.Ext(strings.TrimSuffix(e.Name, ext)) == ".tar" + return ext == ".tar" || filepath.Ext(strings.TrimSuffix(e.Name, ext)) == ".tar" } // }}}