Commit a6d8bbce authored by rswindell's avatar rswindell
Browse files

Eliminated putmsg_fp(), not needed cause printfile() now *always* uses

P_OPENCLOSE method.
parent 44827a66
......@@ -86,32 +86,27 @@ void sbbs_t::printfile(char *str, long mode)
return;
}
if(mode&P_OPENCLOSE) {
length=filelength(file);
if(length<0) {
close(file);
errormsg(WHERE,ERR_CHK,str,length);
return;
}
if((buf=(char*)MALLOC(length+1L))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,str,length+1L);
return;
}
l=lread(file,buf,length);
fclose(stream);
if(l!=length)
errormsg(WHERE,ERR_READ,str,length);
else {
buf[l]=0;
putmsg(buf,mode);
}
FREE(buf);
length=filelength(file);
if(length<0) {
close(file);
errormsg(WHERE,ERR_CHK,str,length);
return;
}
if((buf=(char*)MALLOC(length+1L))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,str,length+1L);
return;
}
l=lread(file,buf,length);
fclose(stream);
if(l!=length)
errormsg(WHERE,ERR_READ,str,length);
else {
putmsg_fp(stream,filelength(file),mode);
fclose(stream);
buf[l]=0;
putmsg(buf,mode);
}
FREE(buf);
if((mode&P_NOABORT || wip || rip || html) && online==ON_REMOTE) {
SYNC;
rioctl(IOSM|ABORT);
......
......@@ -239,7 +239,7 @@ char sbbs_t::putmsg(char HUGE16 *str, long mode)
if(i) /* if valid string, go to top */
continue;
}
if(str[l]!=26)
if(str[l]!=CTRL_Z)
outchar(str[l]);
l++;
}
......@@ -258,19 +258,3 @@ char sbbs_t::putmsg(char HUGE16 *str, long mode)
return(str[l]);
}
/****************************************************************************/
/* Displays a text file to the screen */
/****************************************************************************/
void sbbs_t::putmsg_fp(FILE *fp, long length, long mode)
{
char* buf;
if((buf=(char*)MALLOC(length+1))==NULL) {
errormsg(WHERE,ERR_ALLOC,"fp",length+1);
return;
}
memset(buf,0,length+1);
fread(buf,sizeof(char),length,fp);
putmsg(buf,mode);
FREE(buf);
}
......@@ -452,7 +452,6 @@ public:
void show_msg(smbmsg_t* msg, long mode);
void msgtotxt(smbmsg_t* msg, char *str, int header, int tails);
void quotemsg(smbmsg_t* msg, int tails);
void putmsg_fp(FILE *fp, long length, long mode);
void editmsg(smbmsg_t* msg, uint subnum);
void editor_inf(int xeditnum,char *dest, char *title, long mode
,uint subnum);
......
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