Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Commit 39f6a11

Browse files
committed
Avoid name clash, clean CGO import paths too.
1 parent 5a36837 commit 39f6a11

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

trash.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,9 @@ func listImports(rootPackage, libRoot, pkg string) <-chan util.Packages {
519519
// Extract any includes from the preamble
520520
for _, line := range strings.Split(cg.Text(), "\n") {
521521
if line = strings.TrimSpace(line); strings.HasPrefix(line, "#include \"") {
522-
if path := filepath.Dir(line[10 : len(line)-1]); path != "." {
523-
if _, err := os.Stat(filepath.Join(pkgPath, path)); !os.IsNotExist(err) {
524-
sch <- filepath.Join(pkg, path)
522+
if includePath := filepath.Dir(line[10 : len(line)-1]); includePath != "." {
523+
if _, err := os.Stat(filepath.Join(pkgPath, includePath)); !os.IsNotExist(err) {
524+
sch <- filepath.Clean(filepath.Join(pkg, includePath))
525525
}
526526
}
527527
}

0 commit comments

Comments
 (0)