diff --git a/src/sbbs3/prntfile.cpp b/src/sbbs3/prntfile.cpp index 9419fcd00f810fd7604c905f0a31934eae41a4f1..d20aaa0d35afa4e21c7aa30e315e5e7355116a12 100644 --- a/src/sbbs3/prntfile.cpp +++ b/src/sbbs3/prntfile.cpp @@ -84,10 +84,6 @@ bool sbbs_t::printfile(const char* fname, long mode, long org_cols, JSObject* ob sys_status&=~SS_ABORT; } - if(!(mode&P_NOCRLF) && row > 0 && !rip) { - newline(); - } - if((stream=fnopen(&file,fpath,O_RDONLY|O_DENYNONE))==NULL) { if(!(mode&P_NOERROR)) { lprintf(LOG_NOTICE,"!Error %d (%s) opening: %s" @@ -109,6 +105,10 @@ bool sbbs_t::printfile(const char* fname, long mode, long org_cols, JSObject* ob return true; } + if(!(mode&P_NOCRLF) && row > 0 && !rip) { + newline(); + } + if((mode&P_OPENCLOSE) && length <= PRINTFILE_MAX_FILE_LEN) { if((buf=(char*)malloc(length+1L))==NULL) { fclose(stream); @@ -196,9 +196,6 @@ bool sbbs_t::printtail(const char* fname, int lines, long mode, long org_cols, J } sys_status&=~SS_ABORT; } - if(!(mode&P_NOCRLF) && row > 0) { - newline(); - } if((fp=fnopen(&file,fpath,O_RDONLY|O_DENYNONE))==NULL) { if(!(mode&P_NOERROR)) { lprintf(LOG_NOTICE,"!Error %d (%s) opening: %s" @@ -209,6 +206,9 @@ bool sbbs_t::printtail(const char* fname, int lines, long mode, long org_cols, J } return false; } + if(!(mode&P_NOCRLF) && row > 0) { + newline(); + } length=(long)filelength(file); if(length<0) { fclose(fp);