projects
/
binutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3157bf9
)
_better_file_error
author
Matthias Klose
<doko@debian.org>
Thu, 21 Mar 2019 14:49:23 +0000
(14:49 +0000)
committer
Matthias Klose
<doko@debian.org>
Thu, 21 Mar 2019 14:49:23 +0000
(14:49 +0000)
directory. (#45832)
Gbp-Pq: Name 006_better_file_error.patch
bfd/opncls.c
patch
|
blob
|
history
diff --git
a/bfd/opncls.c
b/bfd/opncls.c
index e27504545cf177497b7c968241445b8beb2e67f2..1392b8c5ccdef408caf93538a84b7a06ea39de11 100644
(file)
--- a/
bfd/opncls.c
+++ b/
bfd/opncls.c
@@
-196,6
+196,13
@@
bfd_fopen (const char *filename, const char *target, const char *mode, int fd)
{
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)