aboutsummaryrefslogtreecommitdiff
path: root/binutils/ar.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-09-12 17:43:21 +0000
committerIan Lance Taylor <ian@airs.com>1999-09-12 17:43:21 +0000
commitc8446de592d508d20ef8f828f1f2155869d6fe82 (patch)
tree1c09b67fce41ed51219f67b14070b9483394144a /binutils/ar.c
parentfe84ea5db28793a9ec7bc78962f0c67afab54c59 (diff)
downloadgdb-c8446de592d508d20ef8f828f1f2155869d6fe82.zip
gdb-c8446de592d508d20ef8f828f1f2155869d6fe82.tar.gz
gdb-c8446de592d508d20ef8f828f1f2155869d6fe82.tar.bz2
1999-09-12 Donn Terry <donn@interix.com>
* ar.c (output_filename): Make const. (open_inarch): If creating a new empty archive, set output_filename.
Diffstat (limited to 'binutils/ar.c')
-rw-r--r--binutils/ar.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/binutils/ar.c b/binutils/ar.c
index fa89f30..e208004 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -306,7 +306,7 @@ normalize (file, abfd)
/* Remove any output file. This is only called via xatexit. */
-static char *output_filename = NULL;
+static const char *output_filename = NULL;
static FILE *output_file = NULL;
static bfd *output_bfd = NULL;
@@ -699,6 +699,9 @@ open_inarch (archive_filename, file)
|| ! bfd_set_format (arch, bfd_archive)
|| ! bfd_close (arch))
bfd_fatal (archive_filename);
+
+ /* If we die creating a new archive, don't leave it around. */
+ output_filename = archive_filename;
}
arch = bfd_openr (archive_filename, target);