Commit 1d279c52 authored by rswindell's avatar rswindell
Browse files

Fix bug reported by Deuce: when editing an existing message, don't convert

tear lines (---) to non-tear lines (-+-).
parent 9085607a
......@@ -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 2011 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2012 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 *
......@@ -723,6 +723,7 @@ typedef enum { /* Values for xtrn_t.event */
#define WM_QWKNET (1<<7) /* Writing QWK NetMail (25 char title) */
#define WM_PRIVATE (1<<8) /* Private (for creating MSGINF file) */
#define WM_SUBJ_RO (1<<9) /* Subject/title is read-only */
#define WM_EDIT (1<<10) /* Editing existing message */
/* Bits in the mode of loadposts() */
#define LP_BYSELF (1<<0) /* Include messages sent by self */
......
......@@ -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 2011 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2012 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 *
......@@ -133,7 +133,7 @@ int sbbs_t::process_edited_text(char* buf, FILE* stream, long mode, unsigned* li
break;
continue;
}
if(!(mode&(WM_EMAIL|WM_NETMAIL))
if(!(mode&(WM_EMAIL|WM_NETMAIL|WM_EDIT))
&& (!l || buf[l-1]==LF)
&& buf[l]=='-' && buf[l+1]=='-' && buf[l+2]=='-'
&& (buf[l+3]==' ' || buf[l+3]==TAB || buf[l+3]==CR))
......@@ -1025,7 +1025,7 @@ bool sbbs_t::editfile(char *fname, bool msg)
rioctl(IOCM|PAUSE|ABORT);
if(external(cmdstr(cfg.xedit[useron.xedit-1]->rcmd,msgtmp,nulstr,NULL),mode,cfg.node_dir)!=0)
return false;
l=process_edited_file(msgtmp, path, /* mode: */0, &lines,maxlines);
l=process_edited_file(msgtmp, path, /* mode: */WM_EDIT, &lines,maxlines);
if(l>0) {
SAFEPRINTF4(str,"%s created or edited file: %s (%u bytes, %u lines)"
,useron.alias, path, l, lines);
......@@ -1071,7 +1071,7 @@ bool sbbs_t::editfile(char *fname, bool msg)
free(buf);
return false;
}
l=process_edited_text(buf,stream,/* mode: */0,&lines,maxlines);
l=process_edited_text(buf,stream,/* mode: */WM_EDIT,&lines,maxlines);
bprintf(text[SavedNBytes],l,lines);
fclose(stream);
free(buf);
......
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