* nm.c (display_archive): Close each archive element after it has
authorIan Lance Taylor <ian@airs.com>
Tue, 29 Mar 1994 20:00:09 +0000 (20:00 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 29 Mar 1994 20:00:09 +0000 (20:00 +0000)
been displayed.

binutils/ChangeLog
binutils/nm.c

index e165dfd2591dfcadb20ba53562ef3735c658b524..4749557a331d30b10b59a14d6b117f09b5efc921 100644 (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)
 
        * configure.in: Change error message to refer to bfd/config.bfd
index 6580e7b6992dec2f512e0c2f7fa183b6388c3111..8aca314caf0b0100b5c011a7edba7093d79fa5ff 100644 (file)
@@ -271,6 +271,7 @@ main (argc, argv)
   int retval;
 
   program_name = *argv;
+  xmalloc_set_program_name (program_name);
 
   bfd_init ();
 
@@ -381,7 +382,7 @@ display_archive (file)
 
       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));
          break;
        }
@@ -395,12 +396,14 @@ display_archive (file)
       else
        {
          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);
              free (matching);
            }
        }
+
+      bfd_close (arfile);
     }
 }
 
@@ -431,7 +434,7 @@ display_file (filename)
   else
     {
       bfd_nonfatal (filename);
-      if (bfd_error == file_ambiguously_recognized)
+      if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
        {
          list_matching_formats (matching);
          free (matching);