From 9e02fa746ca12999fd65827964066083d1972b17 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 6 Jul 2018 13:11:24 -0700 Subject: [PATCH] use to/from slash --- src/zip.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/zip.go b/src/zip.go index 33a2990..d8ebeb8 100644 --- a/src/zip.go +++ b/src/zip.go @@ -30,6 +30,7 @@ func unzipFile(src, dest string) (err error) { // Store filename/path for returning and using later on fpath := filepath.Join(dest, f.Name) log.Debugf("unzipping %s", fpath) + fpath = filepath.FromSlash(fpath) if f.FileInfo().IsDir() { @@ -145,6 +146,8 @@ func zipFile(fname string, compress bool) (writtenFilename string, err error) { header.Method = zip.Deflate } + header.Name = filepath.ToSlash(header.Name) + writer, err = zipWriter.CreateHeader(header) if err != nil { return err