patches/binutils/2.17/301-better_file_error.patch
changeset 745 e445c00d134d
parent 55 249c47587aa4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/binutils/2.17/301-better_file_error.patch	Mon Jul 28 20:17:48 2008 +0000
     1.3 @@ -0,0 +1,17 @@
     1.4 +diff -dur binutils-2.17.old/bfd/opncls.c binutils-2.17/bfd/opncls.c
     1.5 +--- binutils-2.17.old/bfd/opncls.c	2006-03-16 13:20:16.000000000 +0100
     1.6 ++++ binutils-2.17/bfd/opncls.c	2007-05-01 18:26:11.000000000 +0200
     1.7 +@@ -158,6 +158,13 @@
     1.8 + {
     1.9 +   bfd *nbfd;
    1.10 +   const bfd_target *target_vec;
    1.11 ++  struct stat s;
    1.12 ++
    1.13 ++  if (stat (filename, &s) == 0)
    1.14 ++    if (S_ISDIR(s.st_mode)) {
    1.15 ++      bfd_set_error (bfd_error_file_not_recognized);
    1.16 ++      return NULL;
    1.17 ++    }
    1.18 + 
    1.19 +   nbfd = _bfd_new_bfd ();
    1.20 +   if (nbfd == NULL)