--- a/src/Pure/General/sql.scala Thu May 04 14:57:31 2017 +0200
+++ b/src/Pure/General/sql.scala Thu May 04 14:58:19 2017 +0200
@@ -387,9 +387,9 @@
if (user == "") error("Undefined database user")
- val db_host = if (host != "") host else "localhost"
+ val db_host = proper_string(host) getOrElse "localhost"
val db_port = if (port > 0 && port != default_port) ":" + port else ""
- val db_name = "/" + (if (database != "") database else user)
+ val db_name = "/" + (proper_string(database) getOrElse user)
val (url, name, port_forwarding) =
ssh match {
--- a/src/Pure/General/ssh.scala Thu May 04 14:57:31 2017 +0200
+++ b/src/Pure/General/ssh.scala Thu May 04 14:58:19 2017 +0200
@@ -77,7 +77,8 @@
def open_session(host: String, user: String = "", port: Int = 0): Session =
{
val session =
- jsch.getSession(if (user == "") null else user, host, if (port > 0) port else default_port)
+ jsch.getSession(proper_string(user) getOrElse null, host,
+ if (port > 0) port else default_port)
session.setUserInfo(No_User_Info)
session.setServerAliveInterval(alive_interval(options))
--- a/src/Pure/PIDE/command_span.scala Thu May 04 14:57:31 2017 +0200
+++ b/src/Pure/PIDE/command_span.scala Thu May 04 14:58:19 2017 +0200
@@ -15,7 +15,7 @@
sealed abstract class Kind {
override def toString: String =
this match {
- case Command_Span(name, _) => if (name != "") name else "<command>"
+ case Command_Span(name, _) => proper_string(name) getOrElse "<command>"
case Ignored_Span => "<ignored>"
case Malformed_Span => "<malformed>"
}
--- a/src/Pure/System/isabelle_system.scala Thu May 04 14:57:31 2017 +0200
+++ b/src/Pure/System/isabelle_system.scala Thu May 04 14:58:19 2017 +0200
@@ -139,11 +139,8 @@
env.getOrElse(name, "")
def getenv_strict(name: String, env: Map[String, String] = settings()): String =
- {
- val value = getenv(name, env)
- if (value != "") value
- else error("Undefined Isabelle environment variable: " + quote(name))
- }
+ proper_string(getenv(name, env)) getOrElse
+ error("Undefined Isabelle environment variable: " + quote(name))
def cygwin_root(): String = getenv_strict("CYGWIN_ROOT")