aboutsummaryrefslogtreecommitdiff
path: root/binutils/ar.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-11-07 12:19:34 +0000
committerNick Clifton <nickc@redhat.com>2003-11-07 12:19:34 +0000
commitf24ddbddc5177a930b867626b12d2bb8b3757223 (patch)
treefe1b8c0703b20b4e188b7c432488a7e2f8874ab1 /binutils/ar.c
parent65ed7f0a337f0c802f4a7c096c833f20c99dfb3e (diff)
downloadgdb-f24ddbddc5177a930b867626b12d2bb8b3757223.zip
gdb-f24ddbddc5177a930b867626b12d2bb8b3757223.tar.gz
gdb-f24ddbddc5177a930b867626b12d2bb8b3757223.tar.bz2
Use consistent error messages for missing files.
Detect directories where an ordinary file is expected.
Diffstat (limited to 'binutils/ar.c')
-rw-r--r--binutils/ar.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/binutils/ar.c b/binutils/ar.c
index 1724171..77fa467 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -1305,7 +1305,9 @@ replace_members (bfd *arch, char **files_to_move, bfd_boolean quick)
/* Add to the end of the archive. */
after_bfd = get_pos_bfd (&arch->next, pos_end, NULL);
- if (ar_emul_append (after_bfd, *files_to_move, verbose))
+
+ if (get_file_size (* files_to_move) > 0
+ && ar_emul_append (after_bfd, *files_to_move, verbose))
changed = TRUE;
next_file:;
@@ -1324,6 +1326,8 @@ ranlib_only (const char *archname)
{
bfd *arch;
+ if (get_file_size (archname) < 1)
+ return;
write_armap = 1;
arch = open_inarch (archname, (char *) NULL);
if (arch == NULL)
@@ -1344,6 +1348,8 @@ ranlib_touch (const char *archname)
bfd *arch;
char **matching;
+ if (get_file_size (archname) < 1)
+ return;
f = open (archname, O_RDWR | O_BINARY, 0);
if (f < 0)
{