Skip to content

Commit

Permalink
Ensure IsTarfile supports uncompressed files (close #121)
Browse files Browse the repository at this point in the history
  • Loading branch information
errordeveloper authored and paultag committed Oct 5, 2022
1 parent b83668a commit f50faa5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deb/tarfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

// }}}
Expand Down

0 comments on commit f50faa5

Please # to comment.