makeutl.adb (Executable_Prefix_Path): If Locate_Exec_On_Path fails...
authorVincent Celier <celier@adacore.com>
Thu, 31 Jul 2008 12:46:11 +0000 (14:46 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 31 Jul 2008 12:46:11 +0000 (14:46 +0200)
2008-07-31  Vincent Celier  <celier@adacore.com>

* makeutl.adb (Executable_Prefix_Path): If Locate_Exec_On_Path fails,
return the empty string, instead of raising Constraint_Error.

From-SVN: r138398

gcc/ada/makeutl.adb

index 1755ade229cfd926d3c2cc7134c498881d282188..a0a909d1ae7dba517e4a86d9a2d9ca0eac8473ef 100644 (file)
@@ -246,7 +246,17 @@ package body Makeutl is
       --  If we get here, the user has typed the executable name with no
       --  directory prefix.
 
-      return Get_Install_Dir (Locate_Exec_On_Path (Exec_Name).all);
+      declare
+         Path : constant String_Access := Locate_Exec_On_Path (Exec_Name);
+
+      begin
+         if Path = null then
+            return "";
+
+         else
+            return Get_Install_Dir (Path.all);
+         end if;
+      end;
    end Executable_Prefix_Path;
 
    ----------