Skip to content

Commit d389731

Browse files
committed
Fix realpath/toAbsolutePath for stdio/currentString
Not actual files, so don't prepend a directory
1 parent 4972989 commit d389731

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

M2/Macaulay2/d/actors5.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,7 @@ setupfun("readlink",readlinkfun);
13331333
13341334
realpathfun(e:Expr):Expr := (
13351335
when e is f:stringCell do (
1336+
if f.v === "stdio" || f.v === "currentString" then return e;
13361337
when realpath(expandFileName(f.v))
13371338
is null do buildErrorPacket(syscallErrorMessage("realpath"))
13381339
is p:string do toExpr(p)

M2/Macaulay2/m2/startup.m2.in

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,12 @@ if firstTime then (
154154
concatPath = (dir, name) -> if isAbsolutePath name then name else concatenate(
155155
dir, if not match("/$", dir) then "/", name);
156156

157-
toAbsolutePath = pth -> if pth =!= "stdio" and not isAbsolutePath pth then "/" | relativizeFilename("/", pth) else pth;
157+
toAbsolutePath = pth -> (
158+
if (
159+
pth =!= "stdio" and
160+
pth =!= "currentString" and
161+
not isAbsolutePath pth)
162+
then "/" | relativizeFilename("/", pth) else pth);
158163

159164
use = x -> x; -- temporary, until methods.m2
160165

0 commit comments

Comments
 (0)