Commit 17ab641b authored by rswindell's avatar rswindell
Browse files

Major over-haul of smb_util.c and most everything that uses it:

Constified the arguments.
Created exascii_to_ascii_char().
Created ctrl_a_to_ascii_char().
strip_ctrl() and prep_file_desc() now takes 2 args.
strip_ctrl(), strip_exascii() and prep_file_desc() now strdup() the input
string and if the dest arg is NULL, returns the allocated and modified copy.
sbbs_t::bputs() now handles ^AZ.
Change Ctrl-A code message network exporting:
1. ^AL, ^A<, ^A[, and ^A] are always translated to ASCII equivalents.
2. ^AZ will terminate the message body prematurely if found.
3. Ex-ASCII (CP437) chars will be translated to ASCII equivalents (rather than
'*') for "ASCII Only" subs.
For import, don't allow Ctrl-AP or Ctrl-AL.
For SBBSecho:
Added support for specifying a link's address on the command-line (e.g. for
use with -h).
Mail server now strips Ctrl-A codes from message bodies for sending via POP3
or SMTP.
parent 1023d4d2
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -286,7 +286,7 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
break;
ext[i]=0;
if(mode&ASCII_ONLY)
strip_exascii(ext);
strip_exascii(ext, ext);
if(!(mode&KEEP_DESC)) {
sprintf(tmpext,"%.256s",ext);
prep_desc(tmpext);
......@@ -307,7 +307,7 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
f.altpath=cur_altpath;
prep_desc(f.desc);
if(mode&ASCII_ONLY)
strip_exascii(f.desc);
strip_exascii(f.desc, f.desc);
if(exist) {
putfiledat(&scfg,&f);
if(!(mode&NO_NEWDATE))
......@@ -489,7 +489,7 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
break;
ext[i]=0;
if(mode&ASCII_ONLY)
strip_exascii(ext);
strip_exascii(ext, ext);
if(!(mode&KEEP_DESC)) {
sprintf(tmpext,"%.256s",ext);
prep_desc(tmpext);
......@@ -512,7 +512,7 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
f.altpath=cur_altpath;
prep_desc(f.desc);
if(mode&ASCII_ONLY)
strip_exascii(f.desc);
strip_exascii(f.desc, f.desc);
if(exist) {
putfiledat(&scfg,&f);
if(!(mode&NO_NEWDATE))
......@@ -887,7 +887,7 @@ int main(int argc, char **argv)
f.altpath=cur_altpath;
prep_desc(f.desc);
if(mode&ASCII_ONLY)
strip_exascii(f.desc);
strip_exascii(f.desc, f.desc);
printf("%s %7lu %s\n",f.name,f.cdt,f.desc);
if(mode&FILE_ID) {
for(i=0;i<scfg.total_fextrs;i++)
......
......@@ -268,7 +268,7 @@ bool sbbs_t::answer()
strcpy(str,VERSION_NOTICE);
strcat(str," ");
strcat(str,COPYRIGHT_NOTICE);
strip_ctrl(str);
strip_ctrl(str, str);
center(str);
while(i++<50 && l<(int)sizeof(str)-1) { /* wait up to 5 seconds for response */
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -43,30 +43,6 @@
#include "sbbs.h"
/***************************************************/
/* Seven bit table for EXASCII to ASCII conversion */
/***************************************************/
static const char *sbtbl="CUeaaaaceeeiiiAAEaAooouuyOUcLYRfaiounNao?--24!<>"
"###||||++||++++++--|-+||++--|-+----++++++++##[]#"
"abrpEout*ono%0ENE+><rj%=o..+n2* ";
/****************************************************************************/
/* Convert string from IBM extended ASCII to just ASCII */
/****************************************************************************/
char* DLLCALL ascii_str(uchar* str)
{
size_t i;
for(i=0;str[i];i++)
if(str[i]&0x80)
str[i]=sbtbl[str[i]^0x80]; /* seven bit table */
else if(str[i]==CTRL_A /* ctrl-a */
&& str[i+1]!=0) /* valid */
i++; /* skip the attribute code */
return((char*)str);
}
/****************************************************************************/
/* Outputs a NULL terminated string locally and remotely (if applicable) */
/* Handles ctrl-a characters */
......@@ -80,10 +56,11 @@ int sbbs_t::bputs(const char *str)
return(eprintf(LOG_INFO,"%s",str));
while(str[l]) {
if(str[l]==CTRL_A /* ctrl-a */
&& str[l+1]!=0) { /* valid */
ctrl_a(str[++l]); /* skip the ctrl-a */
l++; /* skip the attribute code */
if(str[l]==CTRL_A && str[l+1]!=0) {
l++;
if(toupper(str[l])=='Z') /* EOF */
break;
ctrl_a(str[l++]);
continue;
}
if(str[l]=='@') { /* '@' */
......@@ -211,7 +188,7 @@ void sbbs_t::outchar(char ch)
else
outchar_esc=0;
if(term_supports(NO_EXASCII) && ch&0x80)
ch=sbtbl[(uchar)ch^0x80]; /* seven bit table */
ch=exascii_to_ascii_char(ch); /* seven bit table */
if(ch==FF && lncntr>1 && !tos) {
lncntr=0;
CRLF;
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -575,7 +575,7 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
pp=getstrvar(csi,*(int32_t *)csi->ip);
csi->ip+=4;
if(pp && *pp)
strip_ctrl(*pp);
strip_ctrl(*pp, *pp);
return(0);
case ADD_INT_VAR:
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -35,6 +35,9 @@
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
/* TODO: This file is made up almost *entirely* of copy/pasted crap and */
/* it needs to go away - FTN netmail should be handled by sbbsecho anyway. */
#include "sbbs.h"
#include "qwk.h"
......@@ -326,25 +329,32 @@ bool sbbs_t::netmail(const char *into, const char *title, long mode)
pt_zone_kludge(hdr,fido);
if(cfg.netmail_misc&NMAIL_DIRECT) {
sprintf(str,"\1FLAGS DIR\r\n");
SAFECOPY(str,"\1FLAGS DIR\r\n");
write(fido,str,strlen(str)); }
if(mode&WM_FILE) {
sprintf(str,"\1FLAGS KFS\r\n");
SAFECOPY(str,"\1FLAGS KFS\r\n");
write(fido,str,strlen(str)); }
if(cc_sent) {
sprintf(str,"* Originally to: %s\r\n\r\n",into);
SAFEPRINTF(str,"* Originally to: %s\r\n\r\n",into);
write(fido,str,strlen(str)); }
l=0L;
while(l<length) {
if(buf[l]==CTRL_A) /* Ctrl-A, so skip it and the next char */
if(buf[l]==CTRL_A) { /* Ctrl-A, so skip it and the next char */
l++;
if(l>=length || toupper(buf[l])=='Z') /* EOF */
break;
if((ch=ctrl_a_to_ascii_char(buf[l])) != 0)
write(fido,&ch,1);
}
else if(buf[l]!=LF) {
if((uchar)buf[l]==0x8d) /* r0dent i converted to normal i */
buf[l]='i';
write(fido,buf+l,1); }
l++; }
write(fido,buf+l,1);
}
l++;
}
l=0;
write(fido,&l,1); /* Null terminator */
close(fido);
......@@ -863,14 +873,22 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
while(l<n*QWK_BLOCK_LEN && qwkbuf[l]!=QWK_NEWLINE) l++;
l++; }
while(l<n*QWK_BLOCK_LEN) {
if(qwkbuf[l]==CTRL_A) /* Ctrl-A, so skip it and the next char */
length=n*QWK_BLOCK_LEN;
while(l<length) {
if(qwkbuf[l]==CTRL_A) { /* Ctrl-A, so skip it and the next char */
l++;
if(l>=length || toupper(qwkbuf[l])=='Z') /* EOF */
break;
if((ch=ctrl_a_to_ascii_char(qwkbuf[l])) != 0)
write(fido,&ch,1);
}
else if(qwkbuf[l]!=LF) {
if(qwkbuf[l]==QWK_NEWLINE) /* QWK cr/lf char converted to hard CR */
qwkbuf[l]=CR;
write(fido,(char *)qwkbuf+l,1); }
l++; }
write(fido,(char *)qwkbuf+l,1);
}
l++;
}
l=0;
write(fido,&l,1); /* Null terminator */
close(fido);
......
......@@ -1794,8 +1794,8 @@ static void receive_thread(void* arg)
ext[i]=0;
if(!f.desc[0]) { /* use for normal description */
SAFECOPY(desc,ext);
strip_exascii(desc); /* strip extended ASCII chars */
prep_file_desc(desc); /* strip control chars and dupe chars */
strip_exascii(desc, desc); /* strip extended ASCII chars */
prep_file_desc(desc, desc); /* strip control chars and dupe chars */
for(i=0;desc[i];i++) /* find approprate first char */
if(isalnum(desc[i]))
break;
......
......@@ -642,10 +642,7 @@ js_strip_ctrl(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
if((p=js_ValueToStringBytes(cx, argv[0], NULL))==NULL)
return(JS_FALSE);
if((buf=strdup(p))==NULL)
return(JS_FALSE);
strip_ctrl(buf);
buf=strip_ctrl(p, NULL);
js_str = JS_NewStringCopyZ(cx, buf);
free(buf);
......@@ -669,10 +666,7 @@ js_strip_exascii(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
if((p=js_ValueToStringBytes(cx, argv[0], NULL))==NULL)
return(JS_FALSE);
if((buf=strdup(p))==NULL)
return(JS_FALSE);
strip_exascii(buf);
buf=strip_exascii(p, NULL);
js_str = JS_NewStringCopyZ(cx, buf);
free(buf);
......@@ -1201,7 +1195,7 @@ js_html_encode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
esccount++;
tmpbuf[j++]=inbuf[i];
}
else if(ctrl_a && inbuf[i]==1)
else if(ctrl_a && inbuf[i]==CTRL_A)
{
esccount++;
tmpbuf[j++]=inbuf[i];
......@@ -1590,7 +1584,7 @@ js_html_encode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
break;
case ']':
currrow++;
if(hpos!=0 && tmpbuf[i+2]!=CR && !(tmpbuf[i+2]==1 && tmpbuf[i+3]=='['))
if(hpos!=0 && tmpbuf[i+2]!=CR && !(tmpbuf[i+2]==CTRL_A && tmpbuf[i+3]=='['))
{
outbuf[j++]='\r';
outbuf[j++]='\n';
......
......@@ -549,15 +549,6 @@ static ulong sockmimetext(SOCKET socket, smbmsg_t* msg, char* msgtxt, ulong maxl
/* MESSAGE BODY */
lines=0;
#if 0 /* This is now handled in smb_getmsgtxt() */
for(i=0;i<msg->total_hfields;i++) { /* delivery failure notification? */
if(msg->hfield[i].type==SMTPSYSMSG || msg->hfield[i].type==SMB_COMMENT) {
if(!sockprintf(socket,"%s",(char*)msg->hfield_dat[i]))
return(0);
lines++;
}
}
#endif
p=msgtxt;
while(*p && lines<maxlines) {
tp=strchr(p,'\n');
......@@ -1140,6 +1131,8 @@ static void pop3_thread(void* arg)
continue;
}
remove_ctrl_a(msgtxt, msgtxt);
if(lines > 0 /* Works around BlackBerry mail server */
&& lines >= strlen(msgtxt)) /* which requests the number of bytes (instead of lines) using TOP */
lines=-1;
......@@ -2906,7 +2899,7 @@ static void smtp_thread(void* arg)
hdr_lines++;
continue;
}
strip_ctrl(buf);
strip_ctrl(buf, buf);
lprintf(LOG_DEBUG,"%04d SMTP RX: %s", socket, buf);
if(!strnicmp(buf,"HELO",4)) {
p=buf+4;
......@@ -3976,6 +3969,8 @@ static void sendmail_thread(void* arg)
continue;
}
remove_ctrl_a(msgtxt, msgtxt);
port=0;
/* Check if this is a local email ToDo */
......
......@@ -189,7 +189,7 @@ int eprintf(int level, const char *fmt, ...)
vsnprintf(sbuf,sizeof(sbuf),fmt,argptr);
sbuf[sizeof(sbuf)-1]=0;
va_end(argptr);
strip_ctrl(sbuf);
strip_ctrl(sbuf, sbuf);
return(startup->event_lputs(startup->event_cbdata,level,sbuf));
}
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -197,9 +197,11 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum
size+=fprintf(qwk_fp,"%.128s@%.128s%c",msg->to,p,QWK_NEWLINE);
}
else
sprintf(to,"%.128s",msg->to); }
sprintf(to,"%.128s",msg->to);
}
else
sprintf(to,"%.128s@%.128s",msg->to,(char*)msg->to_net.addr); }
sprintf(to,"%.128s@%.128s",msg->to,(char*)msg->to_net.addr);
}
else
sprintf(to,"%.128s@%.128s",msg->to,(char*)msg->to_net.addr);
if(strlen(to)>25) {
......@@ -270,7 +272,8 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum
tear=0;
if(tearwatch==4) { /* watch for LF---LF */
tear=1;
tearwatch=0; }
tearwatch=0;
}
else if(!tearwatch)
tearwatch=1;
else
......@@ -278,22 +281,26 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum
ch=QWK_NEWLINE;
fputc(ch,qwk_fp); /* Replace LF with funky char */
size++;
continue; }
continue;
}
if(ch==CR) { /* Ignore CRs */
if(tearwatch<4) /* LF---CRLF is okay */
tearwatch=0; /* LF-CR- is not okay */
continue; }
continue;
}
if(ch==' ' && tearwatch==4) { /* watch for "LF--- " */
tear=1;
tearwatch=0; }
tearwatch=0;
}
if(ch=='-') { /* watch for "LF---" */
if(l==0 || (tearwatch && tearwatch<4))
tearwatch++;
else
tearwatch=0; }
tearwatch=0;
}
else
tearwatch=0;
......@@ -301,21 +308,24 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum
if(ch<' ' && ch!=1)
ch='.';
else if((uchar)ch>0x7f)
ch='*'; }
ch=exascii_to_ascii_char(ch);
}
if(ch==QWK_NEWLINE) /* funky char */
ch='*';
if(ch==CTRL_A) {
ch=buf[++l];
if(!ch)
if(ch==0 || toupper(ch)=='Z') /* EOF */
break;
if((ch=ctrl_a_to_ascii_char(ch)) != 0) {
fputc(ch,qwk_fp);
size++;
continue;
}
if(mode&A_EXPAND) {
str[0]=0;
switch(toupper(ch)) { /* non-color codes */
case 'L':
SAFECOPY(str,"\x1b[2J\x1b[H");
break;
switch(toupper(ch)) {
case 'W':
SAFECOPY(str,ansi(LIGHTGRAY));
break;
......@@ -328,10 +338,12 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum
case 'I':
SAFECOPY(str,ansi(BLINK));
break;
case '-':
case '_':
case 'N': /* Normal */
SAFECOPY(str,ansi(ANSI_NORMAL));
break;
case 'R': /* Color codes */
case 'R':
SAFECOPY(str,ansi(RED));
break;
case 'G':
......@@ -378,23 +390,22 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum
size+=fwrite(str,sizeof(char),strlen(str),qwk_fp);
continue;
} /* End Expand */
if(mode&A_LEAVE) {
fputc(1,qwk_fp);
fputc(ch,qwk_fp);
size+=2L; }
else /* Strip */
if(toupper(ch)=='L') {
fputc(FF,qwk_fp);
size++; }
continue; } /* End of Ctrl-A shit */
size+=2L;
}
continue;
} /* End of Ctrl-A shit */
fputc(ch,qwk_fp);
size++; }
size++;
}
free(buf);
if(ch!=QWK_NEWLINE) {
fputc(QWK_NEWLINE,qwk_fp); /* make sure it ends in CRLF */
size++; }
size++;
}
if(mode&QM_TAGLINE && !(cfg.sub[subnum]->misc&SUB_NOTAG)) {
if(!tear) /* no tear line */
......@@ -407,13 +418,14 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum
,ch,VERSION_NOTICE,ch,cfg.sub[subnum]->tagline,QWK_NEWLINE);
strcat(str,tmp);
if(!(mode&A_LEAVE))
remove_ctrl_a(str,NULL);
remove_ctrl_a(str,str);
size+=fwrite(str,sizeof(char),strlen(str),qwk_fp);
}
while(size%QWK_BLOCK_LEN) { /* Pad with spaces */
size++;
fputc(' ',qwk_fp); }
fputc(' ',qwk_fp);
}
tt=msg->hdr.when_written.time;
if(localtime_r(&tt,&tm)==NULL)
......
......@@ -576,7 +576,7 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
continue;
}
strupr(buf);
strip_ctrl(buf);
strip_ctrl(buf, buf);
SAFECOPY(subj,msg.subj);
strupr(subj);
if(!strstr(buf,find) && !strstr(subj,find)) {
......@@ -1192,7 +1192,7 @@ long sbbs_t::searchposts(uint subnum, post_t *post, long start, long posts
continue;
}
strupr(buf);
strip_ctrl(buf);
strip_ctrl(buf, buf);
SAFECOPY(subj,msg.subj);
strupr(subj);
if(strstr(buf,search) || strstr(subj,search)) {
......
......@@ -852,17 +852,20 @@ extern "C" {
DLLEXPORT int DLLCALL update_uldate(scfg_t* cfg, file_t* f);
/* str_util.c */
DLLEXPORT char * DLLCALL remove_ctrl_a(const char* instr, char* outstr);
DLLEXPORT char DLLCALL ctrl_a_to_ascii_char(char code);
DLLEXPORT char * DLLCALL truncstr(char* str, const char* set);
DLLEXPORT char * DLLCALL ascii_str(uchar* str);
DLLEXPORT char DLLCALL exascii_to_ascii_char(uchar ch);
DLLEXPORT BOOL DLLCALL findstr(const char *insearch, const char *fname);
DLLEXPORT BOOL DLLCALL findstr_in_string(const char* insearchof, char* string);
DLLEXPORT BOOL DLLCALL findstr_in_list(const char* insearchof, str_list_t list);
DLLEXPORT BOOL DLLCALL trashcan(scfg_t* cfg, const char *insearch, const char *name);
DLLEXPORT char * DLLCALL trashcan_fname(scfg_t* cfg, const char *name, char* fname, size_t);
DLLEXPORT str_list_t DLLCALL trashcan_list(scfg_t* cfg, const char* name);
DLLEXPORT char * DLLCALL strip_exascii(char *str);
DLLEXPORT char * DLLCALL prep_file_desc(char *str);
DLLEXPORT char * DLLCALL strip_ctrl(char *str);
DLLEXPORT char * DLLCALL strip_exascii(const char *str, char* dest);
DLLEXPORT char * DLLCALL prep_file_desc(const char *str, char* dest);
DLLEXPORT char * DLLCALL strip_ctrl(const char *str, char* dest);
DLLEXPORT char * DLLCALL net_addr(net_t* net);
DLLEXPORT BOOL DLLCALL validattr(char a);
DLLEXPORT size_t DLLCALL strip_invalid_attr(char *str);
......@@ -915,8 +918,6 @@ extern "C" {
DLLEXPORT BOOL DLLCALL spamlog(scfg_t* cfg, char* prot, char* action, char* reason
,char* host, char* ip_addr, char* to, char* from);
DLLEXPORT char * DLLCALL remove_ctrl_a(char* instr, char* outstr);
/* data.cpp */
DLLEXPORT time_t DLLCALL getnextevent(scfg_t* cfg, event_t* event);
......@@ -1085,13 +1086,13 @@ extern "C" {
#endif
/* str_util.c */
int bstrlen(char *str);
void backslashcolon(char *str);
ulong ahtoul(char *str); /* Converts ASCII hex to ulong */
size_t bstrlen(const char *str);
char* backslashcolon(char *str);
ulong ahtoul(const char *str); /* Converts ASCII hex to ulong */
char * hexplus(uint num, char *str); /* Hex plus for 3 digits up to 9000 */
uint hptoi(char *str);
int pstrcmp(char **str1, char **str2); /* Compares pointers to pointers */
int strsame(char *str1, char *str2); /* Compares number of same chars */
uint hptoi(const char *str);
int pstrcmp(const char **str1, const char **str2); /* Compares pointers to pointers */
int strsame(const char *str1, const char *str2); /* Compares number of same chars */
/* load_cfg.c */
BOOL md(char *path);
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -1300,7 +1300,7 @@ char* process_areafix(faddr_t addr, char* inbuf, char* password, char* to)
p=(char *)inbuf;
while(*p==1) { /* Skip kludge lines 11/05/95 */
while(*p==CTRL_A) { /* Skip kludge lines 11/05/95 */
FIND_CHAR(p,'\r');
if(*p) {
p++; /* Skip CR (required) */
......@@ -1345,7 +1345,7 @@ char* process_areafix(faddr_t addr, char* inbuf, char* password, char* to)
del_area.tag=NULL;
for(l=0;l<m;l++) {
while(*(p+l) && isspace(*(p+l))) l++;
while(*(p+l)==1) { /* Ignore kludge lines June-13-2004 */
while(*(p+l)==CTRL_A) { /* Ignore kludge lines June-13-2004 */
while(*(p+l) && *(p+l)!='\r') l++;
continue;
}
......@@ -2315,7 +2315,7 @@ int fmsgtosmsg(uchar* fbuf, fmsghdr_t fmsghdr, uint user, uint subnum)
}
ch=fbuf[l];
if(ch==1 && cr) { /* kludge line */
if(ch==CTRL_A && cr) { /* kludge line */
if(!strncmp((char *)fbuf+l+1,"TOPT ",5))
destaddr.point=atoi((char *)fbuf+l+6);
......@@ -2552,7 +2552,7 @@ void getzpt(FILE *stream, fmsghdr_t *hdr)
for(i=0;i<len;i++) {
if(buf[i]=='\n') /* ignore line-feeds */
continue;
if((!i || cr) && buf[i]==1) { /* kludge */
if((!i || cr) && buf[i]==CTRL_A) { /* kludge */
if(!strncmp(buf+i+1,"TOPT ",5))
hdr->destpoint=atoi(buf+i+6);
else if(!strncmp(buf+i+1,"FMPT ",5))
......@@ -3720,11 +3720,15 @@ void export_echomail(char *sub_code,faddr_t addr)
f+=sprintf(fmsgbuf+f,"\1%.512s\r",(char*)msg.hfield_dat[l]);
for(l=0,cr=1;buf[l] && f<fmsgbuflen;l++) {
if(buf[l]==1) { /* Ctrl-A, so skip it and the next char */
if(buf[l]==CTRL_A) { /* Ctrl-A, so skip it and the next char */
char ch;
l++</