* ar.c (main): Clear output_file if we don't change the archive.

(delete_members, replace_members): Likewise.
This commit is contained in:
Ian Lance Taylor 1999-09-12 19:00:11 +00:00
parent 8bea4d5c6c
commit a20a10a650
2 changed files with 16 additions and 3 deletions

View 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> 1999-09-12 Donn Terry <donn@interix.com>
* objdump.c (dump_headers): If wide_output, print Flags header. * objdump.c (dump_headers): If wide_output, print Flags header.

View file

@ -647,17 +647,23 @@ main (argc, argv)
case delete: case delete:
if (files != NULL) if (files != NULL)
delete_members (arch, files); delete_members (arch, files);
else
output_filename = NULL;
break; break;
case move: case move:
if (files != NULL) if (files != NULL)
move_members (arch, files); move_members (arch, files);
else
output_filename = NULL;
break; break;
case replace: case replace:
case quick_append: case quick_append:
if (files != NULL || write_armap > 0) if (files != NULL || write_armap > 0)
replace_members (arch, files, operation == quick_append); replace_members (arch, files, operation == quick_append);
else
output_filename = NULL;
break; break;
/* Shouldn't happen! */ /* Shouldn't happen! */
@ -1179,9 +1185,9 @@ delete_members (arch, files_to_delete)
} }
if (something_changed == true) 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) if (changed)
write_archive (arch); write_archive (arch);
else
output_filename = NULL;
} }
static void static void