Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 30afc7d

Browse files
pirannamafintosh
authored andcommitted
Strip symlinks linkname only for absolute paths (#48)
* Strip symlinks linkname only for absolute paths * Replaced `const` keyword for `var`
1 parent 90b650e commit 30afc7d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ var statAll = function (fs, stat, cwd, ignore, entries) {
4646
var strip = function (map, level) {
4747
return function (header) {
4848
header.name = header.name.split('/').slice(level).join('/')
49-
if (header.linkname) header.linkname = header.linkname.split('/').slice(level).join('/')
49+
50+
var linkname = header.linkname
51+
if (linkname && path.isAbsolute(linkname)) {
52+
header.linkname = linkname.split('/').slice(level).join('/')
53+
}
54+
5055
return map(header)
5156
}
5257
}

0 commit comments

Comments
 (0)