diff --git a/tar.go b/tar.go index b2ffba8e..ee0c4436 100644 --- a/tar.go +++ b/tar.go @@ -146,7 +146,7 @@ func tarFile(tarWriter *tar.Writer, source, dest string) error { } if baseDir != "" { - header.Name = filepath.Join(baseDir, strings.TrimPrefix(path, source)) + header.Name = filepath.ToSlash(filepath.Join(baseDir, strings.TrimPrefix(path, source))) } if header.Name == dest {