diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-09-15 17:59:12 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-09-15 17:59:12 +0800 |
commit | f04b9380031d2534d30976101996d8729fc95937 (patch) | |
tree | b74d5916491f8be62aa1ed499c453f325fb481a4 /mbbsd/bbs.c | |
parent | e27049043bf545aabdc4fbab115712e3ce2a929d (diff) | |
download | pttbbs-f04b9380031d2534d30976101996d8729fc95937.tar pttbbs-f04b9380031d2534d30976101996d8729fc95937.tar.gz pttbbs-f04b9380031d2534d30976101996d8729fc95937.tar.bz2 pttbbs-f04b9380031d2534d30976101996d8729fc95937.tar.lz pttbbs-f04b9380031d2534d30976101996d8729fc95937.tar.xz pttbbs-f04b9380031d2534d30976101996d8729fc95937.tar.zst pttbbs-f04b9380031d2534d30976101996d8729fc95937.zip |
fix previous N fixes again... orz
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3176 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r-- | mbbsd/bbs.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index dcf094e2..a14c197c 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1182,24 +1182,25 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct) /* check textlen */ if(fhdr->textlen > 0) { + int gotnewstat = 0; if(fhdr->textlen != newstat.st_size) { - /* load and append tail data */ - int gotnewstat = 0; #ifdef DEBUG vmsg("textlen != st_size, append tail."); #endif gotnewstat = stat(fpath, &newstat); + /* copy from old content. */ AppendTail(genbuf, fpath, fhdr->textlen); - - /* now update the record. */ - if(gotnewstat != -1) - fhdr->textlen = newstat.st_size; - else - fhdr->textlen = 0; - recordTouched = 1; + } else { + gotnewstat = stat(fpath, &newstat); } + /* now update the record. */ + if(gotnewstat != -1) + fhdr->textlen = newstat.st_size; + else + fhdr->textlen = 0; + recordTouched = 1; } else /* old flavor, no textlen info */ if (oldstat.st_mtime != newstat.st_mtime) { |