This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
if you feed a directory to ar when trying to create an archive, the error is a bit misleading: $ mkdir foo $ touch foo.c $ ar rcv foo.a foo.c foo a - foo.c a - foo ar: foo.a: Is a directory the Debian guys got a bug report a long time ago about this issue: http://bugs.debian.org/45832 but i cant seem to find any conversation on the binutils list about it ... so lets start one :) updated/tweaked patch against latest cvs is attached ... Debian has been using this since 2.11.92.0.5 and Gentoo since 2.15.92.0.2 without any known regressions -mike
Attachment:
pgp00000.pgp
Description: PGP signature
--- bfd/opncls.c +++ bfd/opncls.c @@ -182,6 +182,15 @@ bfd_fopen (const char *filename, const c { bfd *nbfd; const bfd_target *target_vec; + struct stat s; + + if ((fd != -1 && fstat (fd, &s) == 0) || + (fd == -1 && 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)
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |