]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix issue git #109, fail to delete backup
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 13 Oct 2022 12:58:14 +0000 (05:58 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 13 Oct 2022 12:58:14 +0000 (05:58 -0700)
lib/Perl/Tidy.pm

index 4567304b40932bf9d173a1fe8a3b3a650e957f01..37cb3bd6a70b56a0a849be3b090cd1d2ede1e726 100644 (file)
@@ -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 {