comparison src/content.c @ 75:22b3e3dfc8c2 noffle

[svn] Preserve gen info sometimes
author bears
date Sat, 13 May 2000 16:38:39 +0100
parents e612b263934f
children 988cacc01470
comparison
equal deleted inserted replaced
74:c7df2cc65cc1 75:22b3e3dfc8c2
1 /* 1 /*
2 content.c 2 content.c
3 3
4 $Id: content.c 65 2000-05-12 16:52:41Z enz $ 4 $Id: content.c 81 2000-05-13 15:38:39Z bears $
5 */ 5 */
6 6
7 #if HAVE_CONFIG_H 7 #if HAVE_CONFIG_H
8 #include <config.h> 8 #include <config.h>
9 #endif 9 #endif
170 Cont_write( void ) 170 Cont_write( void )
171 { 171 {
172 Bool anythingWritten; 172 Bool anythingWritten;
173 int i; 173 int i;
174 FILE *f; 174 FILE *f;
175 const Over *ov; 175 const Over *ov, *ov_next;
176 176
177 /* Save the overview */ 177 /* Save the overview */
178 if ( ! ( f = fopen( cont.file, "w" ) ) ) 178 if ( ! ( f = fopen( cont.file, "w" ) ) )
179 { 179 {
180 Log_err( "Could not open %s for writing", cont.file ); 180 Log_err( "Could not open %s for writing", cont.file );
183 Log_dbg( "Writing %s (%lu)", cont.file, cont.size ); 183 Log_dbg( "Writing %s (%lu)", cont.file, cont.size );
184 anythingWritten = FALSE; 184 anythingWritten = FALSE;
185 cont.first = -1; 185 cont.first = -1;
186 for ( i = 0; i < cont.size; ++i ) 186 for ( i = 0; i < cont.size; ++i )
187 { 187 {
188 if ( ( ov = cont.elem[ i ] ) ) 188 ov = cont.elem[ i ];
189 { 189 if ( ov )
190 if ( ! Pseudo_isGeneralInfo( Ov_msgId( ov ) ) ) 190 {
191 if ( i + 1 < cont.size )
192 ov_next = cont.elem[ i + 1 ];
193 else
194 ov_next = NULL;
195
196 /*
197 Preserve gen info if it is followed immediately by an
198 article with the next number. In practice, this means
199 that when in auto-subscribed mode, the gen info will
200 remain until the 'group now subscribed' message is
201 expired.
202 */
203 if ( ! Pseudo_isGeneralInfo( Ov_msgId( ov ) )
204 || ( ov_next != NULL &&
205 Ov_numb( ov_next ) - Ov_numb( ov ) == 1 ) )
191 { 206 {
192 if ( ! Ov_write( ov, f ) ) 207 if ( ! Ov_write( ov, f ) )
193 { 208 {
194 Log_err( "Writing of overview line failed" ); 209 Log_err( "Writing of overview line failed" );
195 break; 210 break;