# HG changeset patch # User wenzelm # Date 1618426408 -7200 # Node ID cd84e58aed268b2636abe13abf0ae8cbb286b836 # Parent a96564139fa70056b6fc012bad4ca6dd4734e337 eliminated perl: prefer elementary GNU printenv; diff -r a96564139fa7 -r cd84e58aed26 lib/Tools/getenv --- a/lib/Tools/getenv Wed Apr 14 14:36:13 2021 +0200 +++ b/lib/Tools/getenv Wed Apr 14 20:53:28 2021 +0200 @@ -17,8 +17,7 @@ echo " Options are:" echo " -a display complete environment" echo " -b print values only (doesn't work for -a)" - echo " -d FILE dump complete environment to FILE" - echo " (null terminated entries)" + echo " -d FILE dump complete environment to file (NUL terminated entries)" echo echo " Get value of VARNAMES from the Isabelle settings." echo @@ -78,6 +77,5 @@ if [ -n "$DUMP" ]; then export PATH_JVM="$(platform_path "$PATH")" - exec perl -w -e 'for $key (keys %ENV) { print $key, "=", $ENV{$key}, "\x00"; }' > "$DUMP" + "$ISABELLE_PRINTENV" -0 > "$DUMP" fi - diff -r a96564139fa7 -r cd84e58aed26 src/Doc/System/Misc.thy --- a/src/Doc/System/Misc.thy Wed Apr 14 14:36:13 2021 +0200 +++ b/src/Doc/System/Misc.thy Wed Apr 14 20:53:28 2021 +0200 @@ -220,8 +220,7 @@ Options are: -a display complete environment -b print values only (doesn't work for -a) - -d FILE dump complete environment to FILE - (null terminated entries) + -d FILE dump complete environment to file (NUL terminated entries) Get value of VARNAMES from the Isabelle settings.\} @@ -232,8 +231,11 @@ to be printed. Option \<^verbatim>\-d\ produces a dump of the complete environment to the specified - file. Entries are terminated by the ASCII null character, i.e.\ the C string - terminator. + file. Entries are terminated by the ASCII NUL character, i.e.\ the string + terminator in C. Thus the Isabelle/Scala operation + \<^scala_method>\isabelle.Isabelle_System.init\ can import the settings + environment robustly, and provide its own + \<^scala_method>\isabelle.Isabelle_System.getenv\ function. \