forked from mirrors/tar-split
tar/storage: use filepath
instead of path
This commit is contained in:
parent
6d59e7bc76
commit
c2c2dde4cb
2 changed files with 9 additions and 10 deletions
|
@ -5,7 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"io"
|
||||
"path"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// ErrDuplicatePath is occured when a tar archive has more than one entry for
|
||||
|
@ -61,7 +61,7 @@ func (jup *jsonUnpacker) Next() (*Entry, error) {
|
|||
|
||||
// check for dup name
|
||||
if e.Type == FileType {
|
||||
cName := path.Clean(e.Name)
|
||||
cName := filepath.Clean(e.Name)
|
||||
if _, ok := jup.seen[cName]; ok {
|
||||
return nil, ErrDuplicatePath
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ const emptyByte byte = 0
|
|||
func (jp *jsonPacker) AddEntry(e Entry) (int, error) {
|
||||
// check early for dup name
|
||||
if e.Type == FileType {
|
||||
cName := path.Clean(e.Name)
|
||||
cName := filepath.Clean(e.Name)
|
||||
if _, ok := jp.seen[cName]; ok {
|
||||
return -1, ErrDuplicatePath
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue