]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Only delete original file if there was an error
authorvague666 <redacted>
Sat, 10 Apr 2021 09:43:51 +0000 (11:43 +0200)
committervague666 <redacted>
Sat, 10 Apr 2021 09:43:51 +0000 (11:43 +0200)
scripts/logcompress_perl.pl

index ff423b22080775464f751293af4a17e79d803647..414715c9366d518518ea34ad7e1b546f833acf7d 100644 (file)
@@ -18,7 +18,7 @@ $VERSION = "0.03";
 sub sig_rotate {
     my $input = $_[0]->{real_fname};
     gzip $input => "$input.gz" or Irssi::print("gzip failed: $GzipError", MSGLEVEL_CLIENTERROR);
-    unlink $input if -e "$input.gz";
+    unlink $input if not defined $GzipError && -e "$input.gz";
 }
 
 Irssi::signal_add('log rotated', 'sig_rotate');
git clone https://git.99rst.org/PROJECT