projects
/
dweather.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d4930c4
)
fix day changing logic
author
Dirk Koopman
<djk@tobit.co.uk>
Sun, 28 Dec 2014 19:57:00 +0000
(19:57 +0000)
committer
Dirk Koopman
<djk@tobit.co.uk>
Sun, 28 Dec 2014 19:57:00 +0000
(19:57 +0000)
SMGLog.pm
patch
|
blob
|
history
diff --git
a/SMGLog.pm
b/SMGLog.pm
index d52d9b3f57ec65e244a64d66cb15a4891fe585fe..e826a5301a964584854e080778ce507db24f4c3f 100644
(file)
--- a/
SMGLog.pm
+++ b/
SMGLog.pm
@@
-124,11
+124,11
@@
sub opennext
sub write
{
my ($self, $dayno, $line) = @_;
- if (
!$self->{fh} || $self->{mode} ne "r" || $dayno != $self->{dayno}
) {
+ if (
(!$self->{fh} || $dayno != $self->{dayno}) && $self->{mode} ne "r"
) {
$self->open($dayno, "a+") or confess "can't open $self->{fn} $!";
- }
+ }
- return $self->{fh}
->print("$line\n")
;
+ return $self->{fh}
? $self->{fh}->print("$line\n") : undef
;
}
# read a line from an opened file