Fix #150: MAKE-PATHNAME ignores version in :DEFAULTS.

parent 1dc7212e
......@@ -1254,6 +1254,7 @@ public class Pathname extends LispObject {
boolean nameSupplied = false;
boolean typeSupplied = false;
boolean directorySupplied = false;
boolean versionSupplied = false;
for (int i = 0; i < args.length; i += 2) {
LispObject key = args[i];
LispObject value = args[i + 1];
......@@ -1290,6 +1291,7 @@ public class Pathname extends LispObject {
typeSupplied = true;
} else if (key == Keyword.VERSION) {
version = value;
versionSupplied = true;
} else if (key == Keyword.DEFAULTS) {
defaults = coerceToPathname(value);
} else if (key == Keyword.CASE) {
......@@ -1312,6 +1314,9 @@ public class Pathname extends LispObject {
if (!typeSupplied) {
type = defaults.type;
}
if (!versionSupplied) {
version = defaults.version;
}
}
final Pathname p;
final boolean logical;
......@@ -1385,6 +1390,7 @@ public class Pathname extends LispObject {
p.type = type;
}
}
p.version = version;
return p;
}
......
......@@ -1717,3 +1717,11 @@
(deftest pathname.make-pathname.1
(make-pathname :directory nil :defaults "/home/fare/")
#p"")
(deftest pathname.make-pathname.2
(let ((p (make-pathname
:defaults (make-pathname :name :wild :type :wild :version :wild :directory :wild))))
(values
(pathname-name p) (pathname-type p) (pathname-version p) (pathname-directory p)))
:wild :wild :wild (:absolute :wild))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment