summaryrefslogtreecommitdiff
path: root/sources/binutils-006_better_file_error.patch
blob: 38ef52966e4d44d2dbd02e337030e4889d1ab105 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff -urN binutils-2.11.92.0.5/bfd/opncls.c binutils-2.11.92.0.5.new/bfd/opncls.c
--- binutils-2.11.92.0.5/bfd/opncls.c	Mon Oct  1 18:25:21 2001
+++ binutils-2.11.92.0.5.new/bfd/opncls.c	Sat Oct 13 11:26:59 2001
@@ -127,6 +127,13 @@
 {
   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)