summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-12-14 10:21:51 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2010-12-14 10:21:51 -0500
commitb795eb3698ac4f9751f62f3a30d1e07c52d049d5 (patch)
tree1285189a7783fd76b9a5b68764386777f9b133b5 /src
parent41b1ea45e20f20bc1ca7f44ef366f5f9e4bebb9b (diff)
Better treatment of relative paths in .urp files
Diffstat (limited to 'src')
-rw-r--r--src/compiler.sml5
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