From a142f72e884f598257ace2c62419ddec5f3ed7d0 Mon Sep 17 00:00:00 2001 From: Dan Boger Date: Mon, 10 Aug 2009 22:50:40 -0700 Subject: [PATCH 1/1] Fix typo in binmode. Also, try to make sure the last_poll id never decreases --- twirssi.pl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/twirssi.pl b/twirssi.pl index 1f0f895..aca557c 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -1032,7 +1032,7 @@ sub monitor_child { # pretend if ( open FILE, $filename ) { - bindmode FILE, ":utf8"; + binmode FILE, ":utf8"; my @lines; my %new_cache; while () { @@ -1163,8 +1163,16 @@ sub monitor_child { } if (/^-- (\d+)$/) { - ($new_last_poll) = ($1); - last; + $new_last_poll = $1; + if ( $new_last_poll >= $last_poll ) { + last; + } else { + print "Impossible! ", + "new_last_poll=$new_last_poll < last_poll=$last_poll!" + if &debug; + undef $new_last_poll; + next; + } } my ( $f, $t ) = split ' ', $_; $nicks{$f} = $friends{$f} = $t; -- 2.39.5