Skip to content

Commit ab12b49

Browse files
committed
Fix "path.Clean" behavior to take arch-specific Directory values into account too
1 parent 7d4d322 commit ab12b49

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

manifest/rfc2822.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ func (entry *Manifest2822Entry) SeedArchValues() {
8989
}
9090
}
9191
}
92+
func (entry *Manifest2822Entry) CleanDirectoryValues() {
93+
entry.Directory = path.Clean(entry.Directory)
94+
for field, val := range entry.ArchValues {
95+
if strings.HasSuffix(field, "-Directory") && val != "" {
96+
entry.ArchValues[field] = path.Clean(val)
97+
}
98+
}
99+
}
92100

93101
const StringSeparator2822 = ", "
94102

@@ -385,7 +393,7 @@ func (manifest *Manifest2822) AddEntry(entry Manifest2822Entry) error {
385393
}
386394

387395
entry.DeduplicateSharedTags()
388-
entry.Directory = path.Clean(entry.Directory)
396+
entry.CleanDirectoryValues()
389397

390398
if invalidArchitectures := entry.InvalidArchitectures(); len(invalidArchitectures) > 0 {
391399
return fmt.Errorf("Tags %q has invalid Architectures: %q", entry.TagsString(), strings.Join(invalidArchitectures, ", "))

0 commit comments

Comments
 (0)