|
From: <jgr...@us...> - 2003-07-12 00:22:35
|
Update of /cvsroot/popfile/engine/UI
In directory sc8-pr-cvs1:/tmp/cvs-serv13909/UI
Modified Files:
HTML.pm
Log Message:
Add code to the history cache that checks that the global download_count is valid
Index: HTML.pm
===================================================================
RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v
retrieving revision 1.179
retrieving revision 1.180
diff -C2 -d -r1.179 -r1.180
*** HTML.pm 9 Jul 2003 21:15:40 -0000 1.179
--- HTML.pm 12 Jul 2003 00:22:32 -0000 1.180
***************
*** 2497,2500 ****
--- 2497,2506 ----
my ( $self ) = @_;
+ # We calculate the largest value for the first number in the MSG file
+ # names to verify at the end that the global download_count parameter
+ # has not been corrupted.
+
+ my $max = 0;
+
# First we mark every entry in the history cache with cull set to one, after we have
# looked through the messages directory for message we will delete any of the entries
***************
*** 2521,2527 ****
# just get the base name of the file that we are dealing with
! $history_files[$i] =~ /(popfile\d+=\d+\.msg)$/;
$history_files[$i] = $1;
# If this file already exists in the history cache then just mark it not
# to be culled and move on.
--- 2527,2537 ----
# just get the base name of the file that we are dealing with
! $history_files[$i] =~ /(popfile(\d+)=\d+\.msg)$/;
$history_files[$i] = $1;
+ if ( $2 > $max ) {
+ $max = $2;
+ }
+
# If this file already exists in the history cache then just mark it not
# to be culled and move on.
***************
*** 2547,2550 ****
--- 2557,2564 ----
$self->{need_resort__} = 0;
$self->sort_filter_history( '', '', '' );
+
+ if ( $max > $self->global_config_( 'download_count' ) ) {
+ $self->global_config_( 'download_count', $max+1 );
+ }
}
|