Skip to content
Snippets Groups Projects
Commit c19539c0 authored by rswindell's avatar rswindell
Browse files

Changed parsing of DSZLOG (protocol.log) to account for long filenames and

filenames with spaces in them. <sigh>
parent bfc3ab54
No related branches found
No related tags found
No related merge requests found
...@@ -316,12 +316,6 @@ bool sbbs_t::checkdszlog(file_t* f) ...@@ -316,12 +316,6 @@ bool sbbs_t::checkdszlog(file_t* f)
char* rname; char* rname;
char code; char code;
ulong bytes; ulong bytes;
ulong dte;
ulong cps;
ulong errors;
ulong flows;
ulong block_size;
long serial_no;
FILE* fp; FILE* fp;
bool success=false; bool success=false;
...@@ -331,24 +325,39 @@ bool sbbs_t::checkdszlog(file_t* f) ...@@ -331,24 +325,39 @@ bool sbbs_t::checkdszlog(file_t* f)
unpadfname(f->name,fname); unpadfname(f->name,fname);
/* Increase real path is different (long filename?) */
getfilepath(&cfg,f,rpath); getfilepath(&cfg,f,rpath);
fexistcase(rpath); /* incase of long filename */
rname=getfname(rpath); rname=getfname(rpath);
while(!ferror(fp)) { while(!ferror(fp)) {
if(!fgets(str,sizeof(str),fp)) if(!fgets(str,sizeof(str),fp))
break; break;
sscanf(str,"%c %lu %lu bps %lu cps %lu errors %lu %lu %s %ld" if((p=strrchr(str,' '))!=NULL)
,&code *p=0; /* we don't care about no stinking serial number */
,&bytes p=str;
,&dte code=*p;
,&cps FIND_WHITESPACE(p); // Skip code
,&errors SKIP_WHITESPACE(p);
,&flows bytes=strtoul(p,NULL,10);
,&block_size FIND_WHITESPACE(p); // Skip bytes
,path SKIP_WHITESPACE(p);
,&serial_no); FIND_WHITESPACE(p); // Skip DTE rate
p=getfname(path); /* DSZ stores fullpath, BiModem doesn't */ SKIP_WHITESPACE(p);
FIND_WHITESPACE(p); // Skip "bps" rate
SKIP_WHITESPACE(p);
FIND_WHITESPACE(p); // Skip CPS
SKIP_WHITESPACE(p);
FIND_WHITESPACE(p); // Skip "cps"
SKIP_WHITESPACE(p);
FIND_WHITESPACE(p); // Skip errors
SKIP_WHITESPACE(p);
FIND_WHITESPACE(p); // Skip "errors"
SKIP_WHITESPACE(p);
FIND_WHITESPACE(p); // Skip flows
SKIP_WHITESPACE(p);
FIND_WHITESPACE(p); // Skip block size
SKIP_WHITESPACE(p);
p=getfname(p); /* DSZ stores fullpath, BiModem doesn't */
if(stricmp(p,fname)==0 || stricmp(p,rname)==0) { if(stricmp(p,fname)==0 || stricmp(p,rname)==0) {
/* E for Error or L for Lost Carrier or s for Skipped */ /* E for Error or L for Lost Carrier or s for Skipped */
/* or only sent 0 bytes! */ /* or only sent 0 bytes! */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment