===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 2009-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -223,4 +223,13 @@
end if;
end Value;
+ function Value (Name : String; Default : String) return String is
+ begin
+ if Exists (Name) then
+ return Value (Name);
+
+ else
+ return Default;
+ end if;
+ end Value;
end Ada.Environment_Variables;
===================================================================
@@ -23,6 +23,11 @@
-- Constraint_Error is propagated. If the execution environment does not
-- support environment variables, then Program_Error is propagated.
+ function Value (Name : String; Default : String) return String;
+ -- If the external execution environment supports environment variables and
+ -- an environment variable with the given name currently exists, then Value
+ -- returns its value; otherwise, it returns Default.
+
function Exists (Name : String) return Boolean;
-- If the external execution environment supports environment variables and
-- an environment variable with the given name currently exists, then