# HG changeset patch # User Adam Chlipala # Date 1292340111 18000 # Node ID 8c1996489265df314cf27c9e97e8dd2274e548fd # Parent b4b5788b20ea2ee8a8de4b2b3062701e61de3e2c Better treatment of relative paths in .urp files diff -r b4b5788b20ea -r 8c1996489265 src/compiler.sml --- a/src/compiler.sml Tue Dec 14 09:37:23 2010 -0500 +++ b/src/compiler.sml Tue Dec 14 10:21:51 2010 -0500 @@ -368,6 +368,8 @@ fun pu filename = let + val filename = OS.Path.mkAbsolute {path = filename, relativeTo = OS.FileSys.getDir ()} + val dir = OS.Path.dir filename fun opener () = TextIO.openIn (OS.Path.joinBaseExt {base = filename, ext = SOME "urp"}) @@ -705,7 +707,8 @@ bigLibs := libify' arg :: !bigLibs | "path" => (case String.fields (fn ch => ch = #"=") arg of - [n, v] => pathmap := M.insert (!pathmap, n, v) + [n, v] => ((pathmap := M.insert (!pathmap, n, OS.Path.mkAbsolute {path = v, relativeTo = dir})) + handle OS.Path.Path => ErrorMsg.error "Invalid 'path' directory argument") | _ => ErrorMsg.error "path argument not of the form name=value'") | "onError" => (case String.fields (fn ch => ch = #".") arg of