* ar.c (main): Clear output_file if we don't change the archive.
authorIan Lance Taylor <ian@airs.com>
Sun, 12 Sep 1999 19:00:11 +0000 (19:00 +0000)
committerIan Lance Taylor <ian@airs.com>
Sun, 12 Sep 1999 19:00:11 +0000 (19:00 +0000)
(delete_members, replace_members): Likewise.

binutils/ChangeLog
binutils/ar.c

index 1c4eab0e258e85df9acb04278e25527e4cfb8899..4297c2ae8d0a539336b4183fb93b54f829a8981a 100644 (file)
@@ -1,3 +1,8 @@
+1999-09-12  Ian Lance Taylor  <ian@zembu.com>
+
+       * ar.c (main): Clear output_file if we don't change the archive.
+       (delete_members, replace_members): Likewise.
+
 1999-09-12  Donn Terry  <donn@interix.com>
 
        * objdump.c (dump_headers): If wide_output, print Flags header.
index 50d1edc726c40b99fbf843250b3fac5e4f879969..bdc5103872a025418eb1b43ec53f34b682e80326 100644 (file)
@@ -647,17 +647,23 @@ main (argc, argv)
        case delete:
          if (files != NULL)
            delete_members (arch, files);
+         else
+           output_filename = NULL;
          break;
 
        case move:
          if (files != NULL)
            move_members (arch, files);
+         else
+           output_filename = NULL;
          break;
 
        case replace:
        case quick_append:
          if (files != NULL || write_armap > 0)
            replace_members (arch, files, operation == quick_append);
+         else
+           output_filename = NULL;
          break;
 
          /* Shouldn't happen! */
@@ -1179,9 +1185,9 @@ delete_members (arch, files_to_delete)
     }
 
   if (something_changed == true)
-    {
-      write_archive (arch);
-    }
+    write_archive (arch);
+  else
+    output_filename = NULL;
 }
 
 
@@ -1332,6 +1338,8 @@ replace_members (arch, files_to_move, quick)
 
   if (changed)
     write_archive (arch);
+  else
+    output_filename = NULL;
 }
 
 static void