aboutsummaryrefslogtreecommitdiffstats
path: root/libraries.adb
diff options
context:
space:
mode:
Diffstat (limited to 'libraries.adb')
-rw-r--r--libraries.adb8
1 files changed, 6 insertions, 2 deletions
diff --git a/libraries.adb b/libraries.adb
index f06bd16e5..b52a11da3 100644
--- a/libraries.adb
+++ b/libraries.adb
@@ -75,8 +75,12 @@ package body Libraries is
if Path'Length = 0 then
return;
end if;
- Pathes.Increment_Last;
- Pathes.Table (Pathes.Last) := Path_To_Id (Path);
+ -- Nice message instead of constraint_error.
+ if Path'Length + 2 >= Name_Buffer'Length then
+ Error_Msg ("argument of -P is too long");
+ return;
+ end if;
+ Pathes.Append (Path_To_Id (Path));
end Add_Library_Path;
function Get_Nbr_Pathes return Natural is