Skip to content

Commit 8ec3329

Browse files
authored
Merge pull request #40 from thaJeztah/addTarFile_posix
tarAppender.addTarFile: normalize archivePath to POSIX
2 parents 2de1463 + 9e1498c commit 8ec3329

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

archive.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ func canonicalTarName(name string, isDir bool) string {
296296

297297
// addTarFile adds to the tar archive a file from `srcPath` as `name`
298298
func (ta *tarAppender) addTarFile(srcPath, archivePath string) error {
299+
archivePath = filepath.ToSlash(archivePath)
299300
fi, err := os.Lstat(srcPath)
300301
if err != nil {
301302
return err
@@ -332,7 +333,7 @@ func (ta *tarAppender) addTarFile(srcPath, archivePath string) error {
332333
hdr.Linkname = oldpath
333334
hdr.Size = 0 // This Must be here for the writer math to add up!
334335
} else {
335-
ta.SeenFiles[inode] = archivePath
336+
ta.SeenFiles[inode] = hdr.Name
336337
}
337338
}
338339

0 commit comments

Comments
 (0)