projects
/
binutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a276cb4
)
_better_file_error
author
Matthias Klose
<doko@debian.org>
Sun, 18 Mar 2018 04:51:40 +0000
(
04:51
+0000)
committer
Matthias Klose
<doko@debian.org>
Sun, 18 Mar 2018 04:51:40 +0000
(
04:51
+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 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)