Allow jagidir $use directives to specify absolute paths.
authorFredrik Tolf <fredrik@dolda2000.com>
Thu, 9 Nov 2023 19:41:47 +0000 (20:41 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Thu, 9 Nov 2023 19:41:47 +0000 (20:41 +0100)
src/jagi/fs/Compiler.java

index e7a66a1..60a1c24 100644 (file)
@@ -235,6 +235,12 @@ public class Compiler {
     }
 
     private Path findlib(String nm) {
     }
 
     private Path findlib(String nm) {
+       try {
+           Path p = Paths.get(nm);
+           if(Files.isRegularFile(p))
+               return(p);
+       } catch(InvalidPathException e) {
+       }
        for(Path dir : searchpath) {
            Path jar = dir.resolve(nm + ".jar");
            if(Files.isRegularFile(jar))
        for(Path dir : searchpath) {
            Path jar = dir.resolve(nm + ".jar");
            if(Files.isRegularFile(jar))