--- sbbs/src/sbbs3/load_cfg.c 2018/04/24 16:41:23 1.1 +++ sbbs/src/sbbs3/load_cfg.c 2018/04/24 16:42:37 1.1.1.2 @@ -2,7 +2,7 @@ /* Synchronet configuration load routines (exported) */ -/* $Id: load_cfg.c,v 1.1 2018/04/24 16:41:23 root Exp $ */ +/* $Id: load_cfg.c,v 1.1.1.2 2018/04/24 16:42:37 root Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * @@ -41,18 +41,19 @@ static void prep_cfg(scfg_t* cfg); static void free_attr_cfg(scfg_t* cfg); -char * readtext(long *line, FILE *stream); -int lprintf(int level, char *fmt, ...); /* log output */ +int lprintf(int level, const char *fmt, ...); /* log output */ /****************************************************************************/ /* Initializes system and node configuration information and data variables */ /****************************************************************************/ BOOL DLLCALL load_cfg(scfg_t* cfg, char* text[], BOOL prep, char* error) { - char str[256],fname[13]; int i; long line=0L; +#ifdef SBBS FILE *instream; + char str[256],fname[13]; +#endif if(cfg->size!=sizeof(scfg_t)) { sprintf(error,"cfg->size (%ld) != sizeof(scfg_t) (%d)" @@ -90,6 +91,7 @@ BOOL DLLCALL load_cfg(scfg_t* cfg, char* if(read_attr_cfg(cfg, error)==FALSE) return(FALSE); +#ifdef SBBS if(text!=NULL) { /* Free existing text if allocated */ @@ -101,8 +103,8 @@ BOOL DLLCALL load_cfg(scfg_t* cfg, char* sprintf(error,"%d opening %s",errno,str); return(FALSE); } - for(i=0;icom_base=0xf; /* All nodes use FOSSIL */ @@ -309,116 +312,6 @@ BOOL md(char *inpath) } /****************************************************************************/ -/* Reads special TEXT.DAT printf style text lines, splicing multiple lines, */ -/* replacing escaped characters, and allocating the memory */ -/****************************************************************************/ -char *readtext(long *line,FILE *stream) -{ - char buf[2048],str[2048],tmp[256],*p,*p2; - int i,j,k; - - if(!fgets(buf,256,stream)) - return(NULL); - if(line) - (*line)++; - if(buf[0]=='#') - return(NULL); - p=strrchr(buf,'"'); - if(!p) { - if(line) { - lprintf(LOG_ERR,"No quotation marks in line %d of text.dat",*line); - return(NULL); - } - return(NULL); - } - if(*(p+1)=='\\') /* merge multiple lines */ - while(strlen(buf)<2000) { - if(!fgets(str,255,stream)) - return(NULL); - if(line) - (*line)++; - p2=strchr(str,'"'); - if(!p2) - continue; - strcpy(p,p2+1); - p=strrchr(p,'"'); - if(p && *(p+1)=='\\') - continue; - break; - } - *(p)=0; - k=strlen(buf); - for(i=1,j=0;i