diff --git a/go.sum b/go.sum index ae84ecc..b558027 100644 --- a/go.sum +++ b/go.sum @@ -2,4 +2,5 @@ github.com/go-gl/mathgl v0.0.0-20180804195959-cdf14b6b8f8a h1:2n5w2v3knlspzjJWyQ github.com/go-gl/mathgl v0.0.0-20180804195959-cdf14b6b8f8a/go.mod h1:dvrdneKbyWbK2skTda0nM4B9zSlS2GZSnjX7itr/skQ= golang.org/x/image v0.0.0-20181109002202-aa35264064ba h1:tKfAeDKyjJZwxAJ8TPBZaf6LpvauubUHT8wwpdz+OMM= golang.org/x/image v0.0.0-20181109002202-aa35264064ba/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20181206121112-cd38e8056d9b h1:9WPnadh+EKSlC7bAQtFhmNxmx/rQOj35pa7nFj6b/Dw= golang.org/x/image v0.0.0-20181206121112-cd38e8056d9b/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= diff --git a/lumps/pakfile.go b/lumps/pakfile.go index f2bfce3..3c181d5 100644 --- a/lumps/pakfile.go +++ b/lumps/pakfile.go @@ -45,7 +45,7 @@ func (lump *Pakfile) ToBytes() []byte { func (lump *Pakfile) GetFile(filePath string) ([]byte, error) { filePath = lump.sanitisePath(filePath) for _, f := range lump.zipReader.File { - if lump.sanitisePath(f.Name) == filePath { + if strings.EqualFold(filePath, lump.sanitisePath(f.Name)) == true { rc, err := f.Open() if err != nil { return nil, err @@ -58,5 +58,9 @@ func (lump *Pakfile) GetFile(filePath string) ([]byte, error) { // sanitisePath ensures that the requested path matches internal casing func (lump *Pakfile) sanitisePath(filePath string) string { - return strings.Replace(strings.ToLower(filePath), "\\", "/", -1) + return strings.Replace( + strings.Replace(strings.ToLower(filePath), "\\", "/", -1), + "//", + "/", + -1) }