1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/binutils/2.20/270-better_file_error.patch Sun Jul 03 12:00:37 2011 +0200
1.3 @@ -0,0 +1,43 @@
1.4 +#!/bin/sh -e
1.5 +## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
1.6 +##
1.7 +## All lines beginning with `## DP:' are a description of the patch.
1.8 +## DP: Specify which filename is causing an error if the filename is a
1.9 +## DP: directory. (#45832)
1.10 +
1.11 +if [ $# -ne 1 ]; then
1.12 + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
1.13 + exit 1
1.14 +fi
1.15 +
1.16 +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
1.17 +patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
1.18 +
1.19 +case "$1" in
1.20 + -patch) patch $patch_opts -p1 < $0;;
1.21 + -unpatch) patch $patch_opts -p1 -R < $0;;
1.22 + *)
1.23 + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
1.24 + exit 1;;
1.25 +esac
1.26 +
1.27 +exit 0
1.28 +
1.29 +@DPATCH@
1.30 +diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c binutils-2.14.90.0.6/bfd/opncls.c
1.31 +--- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c 2003-07-23 16:08:09.000000000 +0100
1.32 ++++ binutils-2.14.90.0.6/bfd/opncls.c 2003-09-10 22:35:00.000000000 +0100
1.33 +@@ -150,6 +150,13 @@
1.34 + {
1.35 + bfd *nbfd;
1.36 + const bfd_target *target_vec;
1.37 ++ struct stat s;
1.38 ++
1.39 ++ if (stat (filename, &s) == 0)
1.40 ++ if (S_ISDIR(s.st_mode)) {
1.41 ++ bfd_set_error (bfd_error_file_not_recognized);
1.42 ++ return NULL;
1.43 ++ }
1.44 +
1.45 + nbfd = _bfd_new_bfd ();
1.46 + if (nbfd == NULL)