From ab635c1c3b1f83c82c340c35b2a2321e51f58e60 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Thu, 13 Oct 2022 05:58:14 -0700 Subject: [PATCH] fix issue git #109, fail to delete backup --- lib/Perl/Tidy.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index 4567304b..37cb3bd6 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -1231,9 +1231,9 @@ EOM # failure. Actually, this could happen if you had a file of # all comments (or pod) and deleted everything with -dac (-dap) # for some reason. - if ( !-s $output_file && -s $backup_file && $delete_backup == 1 ) { + if ( !-s $input_file && -s $backup_file && $delete_backup == 1 ) { Warn( -"output file '$output_file' missing or zero length; original '$backup_file' not deleted\n" +"output file '$input_file' missing or zero length; original '$backup_file' not deleted\n" ); } else { @@ -1376,9 +1376,9 @@ EOM # failure. Actually, this could happen if you had a file of # all comments (or pod) and deleted everything with -dac (-dap) # for some reason. - if ( !-s $output_file && -s $backup_name && $delete_backup == 1 ) { + if ( !-s $input_file && -s $backup_name && $delete_backup == 1 ) { Warn( -"output file '$output_file' missing or zero length; original '$backup_name' not deleted\n" +"output file '$input_file' missing or zero length; original '$backup_name' not deleted\n" ); } else { -- 2.39.5