projects
/
binutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5cd15bc
)
_better_file_error
author
Matthias Klose
<doko@debian.org>
Tue, 29 May 2018 13:46:35 +0000
(14:46 +0100)
committer
Matthias Klose
<doko@debian.org>
Tue, 29 May 2018 13:46:35 +0000
(14:46 +0100)
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 458f06ea71bc69665c028011b05645b870150cb1..709689057a423d233897039e15a9b096f3cbe57b 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)