From 8319804fdf2aca16a1e206e26f13c7b386cce525 Mon Sep 17 00:00:00 2001 From: kcwu Date: Wed, 17 Aug 2005 17:28:14 +0000 Subject: code cleanup. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3059 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/edit.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 4b79abd7..ea8b1f87 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -1606,11 +1606,12 @@ write_file(char *fpath, int saveheader, int *islocal, char *mytitle) trim(msg); line++; + /* check crosspost */ if (currstat == POSTING && po ) { - saveheader = str_checksum(msg); - if (saveheader) { + int msgsum = str_checksum(msg); + if (msgsum) { if (postrecord.last_bid != currbid && - postrecord.checksum[po] == saveheader) { + postrecord.checksum[po] == msgsum) { po++; if (po > 3) { postrecord.times++; @@ -1619,9 +1620,8 @@ write_file(char *fpath, int saveheader, int *islocal, char *mytitle) } } else po = 1; - if (currstat == POSTING && line >= curr_buf->totaln / 2 && - sum < 3) { - checksum[sum++] = saveheader; + if (line >= curr_buf->totaln / 2 && sum < 3) { + checksum[sum++] = msgsum; } } } @@ -1638,7 +1638,7 @@ write_file(char *fpath, int saveheader, int *islocal, char *mytitle) if (po && sum == 3) { memcpy(&postrecord.checksum[1], checksum, sizeof(int) * 3); if(postrecord.last_bid != currbid) - postrecord.times = 0; + postrecord.times = 0; } if (!aborted) { if (islocal) @@ -1657,10 +1657,6 @@ write_file(char *fpath, int saveheader, int *islocal, char *mytitle) ptime->tm_mon + 1, ptime->tm_mday, ptime->tm_hour, ptime->tm_min); } fclose(fp); - - if (local_article && (currstat == POSTING)) - return 0; - return 0; } return aborted; } -- cgit v1.2.3