prepend PWD to relative paths
authorblanchet
Sat, 21 Apr 2012 11:15:49 +0200
changeset 47644 2d90e10f61f2
parent 47643 e33c2be488fe
child 47645 8ca67d2b21c2
prepend PWD to relative paths
src/HOL/TPTP/atp_problem_import.ML
--- a/src/HOL/TPTP/atp_problem_import.ML	Sat Apr 21 11:15:49 2012 +0200
+++ b/src/HOL/TPTP/atp_problem_import.ML	Sat Apr 21 11:15:49 2012 +0200
@@ -123,7 +123,13 @@
     |> role = TPTP_Syntax.Role_Conjecture ? mk_meta_not
 
 fun read_tptp_file thy file_name =
-  let val path = Path.explode file_name in
+  let
+    val path =
+      Path.explode file_name
+      |> (fn path =>
+             path |> not (Path.is_absolute path)
+                     ? Path.append (Path.explode "$PWD"))
+  in
     (case parse_tptp_problem (File.read path) of
        (_, s :: ss) =>
        raise SYNTAX ("cannot parse " ^ quote (implode (s :: ss)))