From 38a4b31bd8a6244088d420d25c8778353eab2448 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 18 Sep 2007 08:14:31 +0000 Subject: [PATCH] Bugfixing --- LogRotate/Conf.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/LogRotate/Conf.pm b/LogRotate/Conf.pm index 3b7bd0d..83d9a44 100644 --- a/LogRotate/Conf.pm +++ b/LogRotate/Conf.pm @@ -1178,7 +1178,7 @@ sub directive($$$$$) { if ($negated) { print $p . "Direktive 'create' wird in '$wo' enfernt.\n" if verbose() > 5; - delete $self->{$wo}{'create'} = if exists $self->{$wo}{'create'}; + $self->{$wo}{'create'} = undef; return 1; } @@ -1230,7 +1230,7 @@ sub directive($$$$$) { if ($negated) { print $p . "Direktive 'olddir' wird in '$wo' enfernt.\n" if verbose() > 5; - delete $self->{$wo}{'olddir'} = if exists $self->{$wo}{'olddir'}; + $self->{$wo}{'olddir'} = undef; return 1; } @@ -1661,8 +1661,13 @@ sub log_end($$$$$) { foreach $name ( @{ $self->{'newfile'}{'files'} } ) { %{ $self->{'logfiles'}{$name} } = %{ $self->{'newfile'} }; - $self->{'logfiles'}{$name}{'create'} = {}; - %{ $self->{'logfiles'}{$name}{'create'} } = %{ $self->{'newfile'}{'create'} }; + if ( $self->{'newfile'}{'create'} ) { + $self->{'logfiles'}{$name}{'create'} = {}; + %{ $self->{'logfiles'}{$name}{'create'} } = %{ $self->{'newfile'}{'create'} }; + } + else { + $self->{'logfiles'}{$name}{'create'} = undef; + } $self->{'logfiles'}{$name}{'olddir'} = {}; if ( defined $self->{'newfile'}{'olddir'} ) { %{ $self->{'logfiles'}{$name}{'olddir'} } = %{ $self->{'newfile'}{'olddir'} }; -- 2.39.5