Skip to content

Commit

Permalink
PATHNAME attempt use java.net.URI routines for getFile()
Browse files Browse the repository at this point in the history
  • Loading branch information
easye committed Apr 1, 2023
1 parent 35582f2 commit 71a7cfe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/org/armedbear/lisp/Pathname.java
Original file line number Diff line number Diff line change
Expand Up @@ -2166,7 +2166,14 @@ public LispObject execute(LispObject arg) {
File getFile() {
String namestring = getNamestring(); // XXX UNC pathnames currently have no namestring
if (namestring != null) {
return new File(namestring);
try {
URI uri = new URI(namestring);
return new File(uri);
} catch (URISyntaxException ex) {
return new File(namestring);
} catch (IllegalArgumentException e) {
return new File(namestring);
}
}
error(new FileError("Pathname has no namestring: " + princToString(),
this));
Expand Down

0 comments on commit 71a7cfe

Please sign in to comment.