You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
\f
#include "bfd.h"
#include "progress.h"
else if (bfd_check_format_matches (ibfd, bfd_object, &obj_matching))
{
bfd *obfd;
- bfd_boolean delete;
do_copy:
/* bfd_get_target does not return the correct value until
if (obfd == NULL)
RETURN_NONFATAL (output_filename);
- delete = ! copy_object (ibfd, obfd);
+ if (! copy_object (ibfd, obfd))
+ status = 1;
if (!bfd_close (obfd))
RETURN_NONFATAL (output_filename);
if (!bfd_close (ibfd))
RETURN_NONFATAL (input_filename);
- if (delete)
- {
- unlink_if_ordinary (output_filename);
- status = 1;
- }
}
else
{
if (status == 0 && preserve_dates)
set_times (output_filename, &statbuf);
+ else if (status != 0)
+ unlink_if_ordinary (output_filename);
}
if (change_warn)