tempdir.adb (Tempdir): Do not use environment variable TMPDIR if it designates a...
authorVincent Celier <celier@adacore.com>
Tue, 15 Nov 2005 14:05:07 +0000 (15:05 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 15 Nov 2005 14:05:07 +0000 (15:05 +0100)
2005-11-14  Vincent Celier  <celier@adacore.com>

* tempdir.adb (Tempdir): Do not use environment variable TMPDIR if it
designates a non existent directory.

From-SVN: r107012

gcc/ada/tempdir.adb

index 7daea87e5c6135f292806739e7cdcd6170486a2e..a0b8adacac76fc4d0a23b206eb10a827bb04d508 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2003 Free Software Foundation, Inc.               --
+--          Copyright (C) 2003-2005 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- --
@@ -114,7 +114,10 @@ begin
       Dir : String_Access := Getenv (Tmpdir);
 
    begin
-      if Dir'Length > 0 and then Is_Absolute_Path (Dir.all) then
+      if Dir'Length > 0 and then
+        Is_Absolute_Path (Dir.all) and then
+        Is_Directory (Dir.all)
+      then
          Temp_Dir := new String'(Normalize_Pathname (Dir.all));
       end if;