Skip to content

Commit

Permalink
Change hasTarHeader to hasRarHeader in rar.go (#284)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xuiqzy committed Apr 21, 2021
1 parent 074da64 commit f094792
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rar.go
Expand Up @@ -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" }
Expand Down

0 comments on commit f094792

Please sign in to comment.