Skip to content

Commit 8593a07

Browse files
committed
one more fix?
1 parent d07055c commit 8593a07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/gd/internal/tooling/archives.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func extractZip(src, dest, targetFile, topDir string) error {
117117
// Adjust path if stripping top-level directory
118118
targetName := f.Name
119119
if topDir != "" && targetName != topDir {
120-
targetName = strings.TrimPrefix(targetName, topDir+string(filepath.Separator))
120+
targetName = strings.TrimPrefix(targetName, topDir+"/")
121121
}
122122
if targetName == "" {
123123
continue // Skip top-level directory itself
@@ -128,7 +128,7 @@ func extractZip(src, dest, targetFile, topDir string) error {
128128
if targetFile != "" {
129129
if targetName == targetFile {
130130
foundTarget = true
131-
} else if !strings.HasPrefix(targetFile, targetName+string(filepath.Separator)) {
131+
} else if !strings.HasPrefix(targetFile, targetName+"/") {
132132
continue // Skip files that aren't the target or its parent directories
133133
}
134134
}

0 commit comments

Comments
 (0)