loader: identify_file use -I for names without path
authorJean Privat <jean@pryen.org>
Fri, 5 Dec 2014 03:15:04 +0000 (22:15 -0500)
committerJean Privat <jean@pryen.org>
Sat, 6 Dec 2014 04:25:20 +0000 (23:25 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/loader.nit

index 02fc621..b9e8055 100644 (file)
@@ -217,9 +217,11 @@ redef class ModelBuilder
        do
                # special case for not a nit file
                if path.file_extension != "nit" then
-                       # search in known -I paths
-                       var res = search_module_in_paths(null, path, self.paths)
-                       if res != null then return res
+                       # search dirless files in known -I paths
+                       if path.dirname == "" then
+                               var res = search_module_in_paths(null, path, self.paths)
+                               if res != null then return res
+                       end
 
                        # Found nothins? maybe it is a group...
                        var candidate = null