diff --git a/src/main/java/dk/camelot64/kickc/SourceLoader.java b/src/main/java/dk/camelot64/kickc/SourceLoader.java index 989a0676c..7aae41d16 100644 --- a/src/main/java/dk/camelot64/kickc/SourceLoader.java +++ b/src/main/java/dk/camelot64/kickc/SourceLoader.java @@ -19,6 +19,14 @@ public class SourceLoader { * @return The file if found. null if not. */ public static File loadFile(String fileName, Path currentPath, List searchPaths) { + File fileAbs = new File(fileName); + if(fileAbs.isAbsolute()) + if(fileAbs.exists()) + return fileAbs; + else + return null; + + // File name is relative - look through search paths List allSearchPaths = new ArrayList<>(); if(currentPath != null) allSearchPaths.add(currentPath.toString());