From c8446de592d508d20ef8f828f1f2155869d6fe82 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 12 Sep 1999 17:43:21 +0000 Subject: [PATCH] 1999-09-12 Donn Terry * ar.c (output_filename): Make const. (open_inarch): If creating a new empty archive, set output_filename. --- binutils/ChangeLog | 6 ++++++ binutils/ar.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index ce2dede871..a1cfa554e9 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +1999-09-12 Donn Terry + + * ar.c (output_filename): Make const. + (open_inarch): If creating a new empty archive, set + output_filename. + 1999-09-12 Ian Lance Taylor * ar.c (full_pathname): New static variable. diff --git a/binutils/ar.c b/binutils/ar.c index fa89f300c8..e2080049c0 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); -- 2.34.1