Skip to content

Commit a9a0c2d

Browse files
authored
Merge pull request #225 from mattmoor/fix-windows
Use path vs. filepath, so that the library cleans things properly on Windows
2 parents 3f61aae + a93231c commit a9a0c2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

estargz/estargz.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
"io/ioutil"
3737
"os"
3838
"path"
39-
"path/filepath"
4039
"sort"
4140
"strconv"
4241
"strings"
@@ -820,7 +819,8 @@ func formatModtime(t time.Time) string {
820819
}
821820

822821
func cleanEntryName(name string) string {
823-
return strings.TrimPrefix(filepath.Clean("/"+name), "/")
822+
// Use path.Clean to consistently deal with path separators across platforms.
823+
return strings.TrimPrefix(path.Clean("/"+name), "/")
824824
}
825825

826826
// countWriter counts how many bytes have been written to its wrapped

0 commit comments

Comments
 (0)