* nm.c (display_archive): Close each archive element after it has

been displayed.
This commit is contained in:
Ian Lance Taylor 1994-03-29 20:00:09 +00:00
parent a87c93b716
commit 9f191108c1
2 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Tue Mar 29 14:59:04 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* nm.c (display_archive): Close each archive element after it has
been displayed.
Mon Mar 28 13:04:08 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Mon Mar 28 13:04:08 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* configure.in: Change error message to refer to bfd/config.bfd * configure.in: Change error message to refer to bfd/config.bfd

View file

@ -271,6 +271,7 @@ main (argc, argv)
int retval; int retval;
program_name = *argv; program_name = *argv;
xmalloc_set_program_name (program_name);
bfd_init (); bfd_init ();
@ -381,7 +382,7 @@ display_archive (file)
if (arfile == NULL) if (arfile == NULL)
{ {
if (bfd_error != no_more_archived_files) if (bfd_get_error () != bfd_error_no_more_archived_files)
bfd_fatal (bfd_get_filename (file)); bfd_fatal (bfd_get_filename (file));
break; break;
} }
@ -395,12 +396,14 @@ display_archive (file)
else else
{ {
bfd_nonfatal (bfd_get_filename (arfile)); bfd_nonfatal (bfd_get_filename (arfile));
if (bfd_error == file_ambiguously_recognized) if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
{ {
list_matching_formats (matching); list_matching_formats (matching);
free (matching); free (matching);
} }
} }
bfd_close (arfile);
} }
} }
@ -431,7 +434,7 @@ display_file (filename)
else else
{ {
bfd_nonfatal (filename); bfd_nonfatal (filename);
if (bfd_error == file_ambiguously_recognized) if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
{ {
list_matching_formats (matching); list_matching_formats (matching);
free (matching); free (matching);