1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
From: David Kimdon <dwhedon@gordian.com>
Date: Wed, 19 Sep 2001 16:52:42 -0700
Subject: Specify which filename is causing an error if the filename is a
directory
Bug-Debian: https://bugs.debian.org/45832
Forwarded: not-needed
---
bfd/opncls.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/bfd/opncls.c b/bfd/opncls.c
index 788b034..1f67ac0 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -150,6 +150,13 @@ bfd_openr (const char *filename, const char *target)
{
bfd *nbfd;
const bfd_target *target_vec;
+ struct stat s;
+
+ if (stat (filename, &s) == 0)
+ if (S_ISDIR(s.st_mode)) {
+ bfd_set_error (bfd_error_file_not_recognized);
+ return NULL;
+ }
nbfd = _bfd_new_bfd ();
if (nbfd == NULL)
|