From 68b13299c5fe2ddd9114de3854f7976aecf346f6 Mon Sep 17 00:00:00 2001 From: xuiqzy Date: Tue, 20 Apr 2021 20:26:09 +0200 Subject: [PATCH] Change hasTarHeader to hasRarHeader in rar.go I think that was a typo, since the bytes in the byte slice even say "Rar", so I guess it is a rar specific header being checked here. --- rar.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rar.go b/rar.go index 56c2a3e3..35fd60b6 100644 --- a/rar.go +++ b/rar.go @@ -405,9 +405,9 @@ func (*Rar) Match(file io.ReadSeeker) (bool, error) { if n, err := file.Read(buf); err != nil || n < 8 { return false, nil } - hasTarHeader := bytes.Equal(buf[:7], []byte("Rar!\x1a\x07\x00")) || // ver 1.5 + hasRarHeader := bytes.Equal(buf[:7], []byte("Rar!\x1a\x07\x00")) || // ver 1.5 bytes.Equal(buf, []byte("Rar!\x1a\x07\x01\x00")) // ver 5.0 - return hasTarHeader, nil + return hasRarHeader, nil } func (r *Rar) String() string { return "rar" }