diff options
author | 2010-12-14 10:21:51 -0500 | |
---|---|---|
committer | 2010-12-14 10:21:51 -0500 | |
commit | b795eb3698ac4f9751f62f3a30d1e07c52d049d5 (patch) | |
tree | 1285189a7783fd76b9a5b68764386777f9b133b5 | |
parent | 41b1ea45e20f20bc1ca7f44ef366f5f9e4bebb9b (diff) |
Better treatment of relative paths in .urp files
-rw-r--r-- | src/compiler.sml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler.sml b/src/compiler.sml index 4fa4fcc8..e8da379c 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -368,6 +368,8 @@ fun parseUrp' accLibs fname = 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 @@ fun parseUrp' accLibs fname = 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 |