Commit 7e20f146 authored by rswindell's avatar rswindell
Browse files

No longer writes the same (duplicate) bundle name to the FLO file if it's

already listed.
parent 4dce639c
......@@ -360,7 +360,11 @@ faddr_t getsysfaddr(short zone)
******************************************************************************/
int write_flofile(char *attachment, faddr_t dest)
{
char fname[256],outbound[128],str[128],ch;
char fname[MAX_PATH+1];
char outbound[MAX_PATH+1];
char str[MAX_PATH+1];
char ch;
char searchstr[MAX_PATH+1];
ushort attr=0;
int i,file;
FILE *stream;
......@@ -391,12 +395,14 @@ int write_flofile(char *attachment, faddr_t dest)
sprintf(fname,"%s%08x.%clo",outbound,dest.point,ch);
else
sprintf(fname,"%s%04x%04x.%clo",outbound,dest.net,dest.node,ch);
sprintf(searchstr,"^%s",attachment);
if(findstr(searchstr,fname)) /* file already in FLO file */
return(0);
if((stream=fnopen(&file,fname,O_WRONLY|O_APPEND|O_CREAT))==NULL) {
printf("\7ERROR line %d opening %s %s\n",__LINE__,fname,sys_errlist[errno]);
logprintf("ERROR line %d opening %s %s",__LINE__,fname,sys_errlist[errno]);
return(-1); }
fseek(stream,0L,SEEK_END);
return(-1);
}
fprintf(stream,"^%s\r\n",attachment);
fclose(stream);
return(0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment