From: Steve Hancock Date: Thu, 13 Oct 2022 12:58:14 +0000 (-0700) Subject: fix issue git #109, fail to delete backup X-Git-Tag: 20220613.06~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ab635c1c3b1f83c82c340c35b2a2321e51f58e60;p=perltidy.git fix issue git #109, fail to delete backup --- 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 {