diff options
| author | dedeibel | 2017-01-03 21:26:25 +0100 |
|---|---|---|
| committer | dedeibel | 2017-01-20 09:43:42 +0100 |
| commit | 9d4f90c395fef0b7eaa382000a82e26b671f5a20 (patch) | |
| tree | 9f1fa518f4fab4b4f85f893fcf4e08b1488a752a | |
| parent | 9da504bbb393dc265a6106df47e1488b26fd09ad (diff) | |
| download | scripts.irssi.org-9d4f90c395fef0b7eaa382000a82e26b671f5a20.tar.bz2 | |
Removed early exit when writing files which prevented deleting the last entry of a list. Closed files after creating them (touch)
| -rw-r--r-- | scripts/nickserv.pl | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/scripts/nickserv.pl b/scripts/nickserv.pl index 216a6b7..02a5983 100644 --- a/scripts/nickserv.pl +++ b/scripts/nickserv.pl @@ -147,8 +147,6 @@ sub save_nickservnet { my ($file) = @_; - return unless scalar @nickservnet; # there's nothing to save - if (-e $file) { local *F; open(F, ">", $file); @@ -206,7 +204,6 @@ sub load_nickservnick { } sub load_nickservpostcmd { - my ($file) = @_; @nickservpostcmd = (); @@ -230,11 +227,8 @@ sub load_nickservpostcmd { } sub save_nickservnick { - my ($file) = @_; - return unless scalar @nickservauth; # there's nothing to save - if (-e $file) { local *F; open(F, ">", $file); @@ -251,11 +245,8 @@ sub save_nickservnick { } sub save_nickservpostcmd { - my ($file) = @_; - return unless scalar @nickservpostcmd; # there's nothing to save - if (-e $file) { local *F; open(F, ">", $file); @@ -272,11 +263,10 @@ sub save_nickservpostcmd { } sub create_save_file { - my ($file) = @_; - my $umask = umask 0077; # save old umask open(F, ">", $file) or die "Can't create $file. Reason: $!"; + close(F); umask $umask; } @@ -565,7 +555,7 @@ sub nickserv_notice { } elsif ($text =~ /^Password accepted - you are now recognized/ || $text =~ /^You are now identified for/) { Irssi::signal_stop(); Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'password_accepted', $server->{tag}); - run_postcmds($server, $server->{tag}, $server->{nick}) + run_postcmds($server, $server->{tag}, $server->{nick}) } elsif ($text =~ /^Password Incorrect/ || $text =~ /^Password incorrect./) { Irssi::signal_stop(); Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'password_wrong', $server->{tag}); |
