tuned;
authorwenzelm
Wed, 30 Jun 2021 14:03:14 +0200
changeset 73903 9849943b83fa
parent 73902 4df63c3a4c4f
child 73904 51f510517aa0
tuned;
src/Pure/System/isabelle_env.scala
--- a/src/Pure/System/isabelle_env.scala	Wed Jun 30 13:49:32 2021 +0200
+++ b/src/Pure/System/isabelle_env.scala	Wed Jun 30 14:03:14 2021 +0200
@@ -21,16 +21,19 @@
   /** bootstrap information **/
 
   def bootstrap_directory(
-    preference: String, envar: String, property: String, description: String): String =
+    preference: String, variable: String, property: String, description: String): String =
   {
-    val value =
-      proper_string(preference) orElse  // explicit argument
-      proper_string(System.getenv(envar)) orElse  // e.g. inherited from running isabelle tool
-      proper_string(System.getProperty(property)) getOrElse  // e.g. via JVM application boot process
-      error("Unknown " + description + " directory")
+    val a = preference  // explicit argument
+    val b = System.getenv(variable)  // e.g. inherited from running isabelle tool
+    val c = System.getProperty(property)  // e.g. via JVM application boot process
+    val dir =
+      if (a != null && a.nonEmpty) a
+      else if (b != null && b.nonEmpty) b
+      else if (c != null && c.nonEmpty) c
+      else error("Unknown " + description + " directory")
 
-    if ((new JFile(value)).isDirectory) value
-    else error("Bad " + description + " directory " + quote(value))
+    if ((new JFile(dir)).isDirectory) dir
+    else error("Bad " + description + " directory " + quote(dir))
   }