[comp.sys.amiga] uupc patch 2

jw@sics.se (Johan Widen) (03/25/88)

Incoming news spool files were not named in a consistent manner. The messed
up the ordering of the articles.

*** dcp.c.old	Fri Mar 25 04:11:17 1988
--- dcp.c	Fri Mar 25 04:11:56 1988
***************
*** 16,22 ****
   * This program implements a uucico type file transfer and remote
   * execution type protocol.
   */
! #define  VERSION "1.10 Camelot"
  #include "dcp.h"
  #include <signal.h>
  /**/
--- 16,22 ----
   * This program implements a uucico type file transfer and remote
   * execution type protocol.
   */
! #define  VERSION "1.11 Camelot"
  #include "dcp.h"
  #include <signal.h>
  /**/
*** ulib.c.old	Fri Mar 25 04:08:42 1988
--- ulib.c	Fri Mar 25 04:10:48 1988
***************
*** 258,291 ****
  	int	bytesRead;
  	
  	static int count = 0;
- 	int	len;
  	
! 	/* inname is of form "D.jlamiBCnnnn".  Pick off the nnnn. */
! 	len = strlen( inname ) - 1;
! 	while ( len >= 0 )
! 	  {
! 		if ( '0' <= inname[len] && inname[len] <= '9' )
! 		   --len;
! 		else
! 		   break;
! 	   }
  
! 	sprintf( filename, "%s/%s", newsdir, &inname[len+1] );
! 	if ( (f = FOPEN( filename, "r", 't' )) != NULL )
! 	   {
! 		/* Already exists, so make a timestamped one. */
! 		fclose( f );	
! 		tloc = time( (long *)NULL );
! 		thetm = localtime( &tloc );
! 
! 		sprintf( filename, "%s/%02d%02d%02d%02d%02d%02d.%03d",
! 			newsdir,
! 			thetm->tm_year % 100, thetm->tm_mon,
! 			thetm->tm_mday, thetm->tm_hour,
! 			thetm->tm_min,  thetm->tm_sec,  count
! 			);
! 		++count;
! 	   }
  	
  	if ( (f = FOPEN( filename, "w", 't' )) == (FILE *)NULL ) {
  		fprintf( stderr, "rnews: can't open %s\n", filename );
--- 258,274 ----
  	int	bytesRead;
  	
  	static int count = 0;
  	
! 	tloc = time( (long *)NULL );
! 	thetm = localtime( &tloc );
  
! 	sprintf( filename, "%s/%02d%02d%02d%02d%02d%02d.%03d",
! 		newsdir,
! 		thetm->tm_year % 100, thetm->tm_mon,
! 		thetm->tm_mday, thetm->tm_hour,
! 		thetm->tm_min,  thetm->tm_sec,  count
! 		);
! 	++count;
  	
  	if ( (f = FOPEN( filename, "w", 't' )) == (FILE *)NULL ) {
  		fprintf( stderr, "rnews: can't open %s\n", filename );

Johan Widen
SICS, PO Box 1263, S-164 28 KISTA, SWEDEN
Tel: +46 8 752 15 32	Ttx: 812 61 54 SICS S	Fax: +46 8 751 72 30
Internet: jw@sics.se or {mcvax,munnari,ukc,unido}!enea!sics.se!jw
-- 
Johan Widen
SICS, PO Box 1263, S-164 28 KISTA, SWEDEN
Tel: +46 8 752 15 32	Ttx: 812 61 54 SICS S	Fax: +46 8 751 72 30
Internet: jw@sics.se or {mcvax,munnari,ukc,unido}!enea!sics.se!jw