From 3382e681e1a9248c1648af81d53d79449eacc082 Mon Sep 17 00:00:00 2001 From: piaip Date: Sat, 17 Sep 2005 05:11:52 +0000 Subject: fixed FILE_REPLIED: ent was used as a temp buffer for curredit in mail_reply. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3182 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/edit.c | 12 ++++++++++-- mbbsd/mail.c | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 5a38289b..af58f2ea 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -2705,7 +2705,7 @@ vedit(char *fpath, int saveheader, int *islocal) int money = 0; int interval = 0; time4_t th = now; - int count = 0, tin = 0; + int count = 0, tin = 0, quoted = 0; char trans_buffer[256]; char mytitle[STRLEN]; @@ -2732,9 +2732,11 @@ vedit(char *fpath, int saveheader, int *islocal) if (*quote_file) { do_quote(); *quote_file = '\0'; + quoted = 1; } - if(curr_buf->oldcurrline != curr_buf->firstline || curr_buf->currline != curr_buf->firstline) { + if( curr_buf->oldcurrline != curr_buf->firstline || + curr_buf->currline != curr_buf->firstline) { /* we must adjust because cursor (currentline) moved. */ curr_buf->oldcurrline = curr_buf->currline = curr_buf->top_of_win = curr_buf->firstline= adjustline(curr_buf->firstline, WRAPMARGIN); @@ -2744,6 +2746,12 @@ vedit(char *fpath, int saveheader, int *islocal) curr_buf->currpnt = curr_buf->currln = curr_buf->curr_window_line = curr_buf->edit_margin = curr_buf->last_margin = 0; + /* if quote, move to end of file. */ + if(quoted) + { + /* maybe do this in future. */ + } + while (1) { if (curr_buf->redraw_everything || has_block_selection()) { refresh_window(); diff --git a/mbbsd/mail.c b/mbbsd/mail.c index e01a0b68..04aefeb6 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -1105,6 +1105,7 @@ mail_reply(int ent, fileheader_t * fhdr, const char *direct) char *t; FILE *fp; char genbuf[512]; + int oent = ent; stand_title("¦^ «H"); @@ -1156,7 +1157,7 @@ mail_reply(int ent, fileheader_t * fhdr, const char *direct) !(fhdr->filemode & FILE_REPLIED)) { fhdr->filemode |= FILE_REPLIED; - substitute_ref_record(direct, fhdr, ent); + substitute_ref_record(direct, fhdr, oent); } break; } -- cgit v1.2.3