From dbc7fb3dc2102689152cb319285d51c50c7ceb5b Mon Sep 17 00:00:00 2001 From: Dave Cunningham Date: Fri, 3 Nov 2017 00:33:43 -0400 Subject: [PATCH] search jpaths from right to left, compatibility with cpp (#140) --- imports.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports.go b/imports.go index 5bd2101..4aa7eac 100644 --- a/imports.go +++ b/imports.go @@ -128,7 +128,7 @@ func (importer *FileImporter) Import(dir, importedPath string) *ImportedData { return &ImportedData{err: err} } - for i := 0; !found && i < len(importer.JPaths); i++ { + for i := len(importer.JPaths) - 1; !found && i >= 0; i-- { found, content, foundHere, err = tryPath(importer.JPaths[i], importedPath) if err != nil { return &ImportedData{err: err}