search jpaths from right to left, compatibility with cpp (#140)

This commit is contained in:
Dave Cunningham 2017-11-03 00:33:43 -04:00 committed by GitHub
parent 4356f42578
commit dbc7fb3dc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,7 +128,7 @@ func (importer *FileImporter) Import(dir, importedPath string) *ImportedData {
return &ImportedData{err: err} 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) found, content, foundHere, err = tryPath(importer.JPaths[i], importedPath)
if err != nil { if err != nil {
return &ImportedData{err: err} return &ImportedData{err: err}