summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-26 07:42:56 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-26 07:42:56 +0000
commitb40cc2cb89352a95e00fc1d02999efba6ef04a9d (patch)
treea486ea33713c119eb2fbe582c216b422b21e8754
parent059bd36acc8230bab41eac1a432c42d560c7d755 (diff)
downloadppe42-gcc-b40cc2cb89352a95e00fc1d02999efba6ef04a9d.tar.gz
ppe42-gcc-b40cc2cb89352a95e00fc1d02999efba6ef04a9d.zip
2008-03-26 Vincent Celier <celier@adacore.com>
* a-direct.adb (Start_Search): Raise Use_Error if the directory is not readable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133581 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/a-direct.adb14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ada/a-direct.adb b/gcc/ada/a-direct.adb
index ea7f02c008d..39a49c96090 100644
--- a/gcc/ada/a-direct.adb
+++ b/gcc/ada/a-direct.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, 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- --
@@ -1197,10 +1197,15 @@ package body Ada.Directories is
C_File_Name : constant String := Directory & ASCII.NUL;
begin
- -- First, the invalid case
+ -- First, the invalid cases
if not Is_Directory (Directory) then
- raise Name_Error;
+ raise Name_Error
+ with "unknown directory """ & Simple_Name (Directory) & '"';
+
+ elsif not Is_Readable_File (Directory) then
+ raise Use_Error
+ with "unreadable directory """ & Simple_Name (Directory) & '"';
end if;
-- If needed, finalize Search
@@ -1219,7 +1224,8 @@ package body Ada.Directories is
exception
when Error_In_Regexp =>
Free (Search.Value);
- raise Name_Error;
+ raise Name_Error
+ with "invalid pattern """ & Pattern & '"';
end;
-- Initialize some Search components
OpenPOWER on IntegriCloud