Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(pathname-directory "./../lib/abcl-aio.jar") -> (:RELATIVE "lib") #427

Closed
alanruttenberg opened this issue Jan 6, 2022 · 2 comments
Closed

Comments

@alanruttenberg
Copy link
Collaborator

That's wrong. Should be (:relative :up "lib").

(pathname-directory "../lib/abcl-aio.jar")
gets the right answer

@alanruttenberg
Copy link
Collaborator Author

diff --git a/src/org/armedbear/lisp/Pathname.java b/src/org/armedbear/lisp/Pathname.java
index ac2bbf35..77280326 100644
--- a/src/org/armedbear/lisp/Pathname.java
+++ b/src/org/armedbear/lisp/Pathname.java
@@ -296,6 +296,8 @@ public class Pathname extends LispObject
       result.setDirectory(new Cons(Keyword.RELATIVE));
       return result;
     } 
+    if (s.startsWith("./"))
+      { s = s.substring(2); }
     if (s.equals("..") || s.equals("../")) {
       result.setDirectory(list(Keyword.RELATIVE, Keyword.UP));
       return result;

@easye
Copy link
Collaborator

easye commented Aug 18, 2023

Present in abcl-1.9.2

CL-USER> (pathname-directory "./../lib/abcl-aio.jar")
(:RELATIVE :UP "lib")
CL-USER> (lisp-implementation-version)
"1.9.3-dev"
"OpenJDK_64-Bit_Server_VM-MacPorts-17.0.8+7"
"aarch64-Mac_OS_X-13.5.1"
CL-USER> 

@easye easye closed this as completed Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants