summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-03-05 18:42:03 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-03-05 18:42:03 +0800
commit8f6ded91d13206bfd09c68f8f6513e45eb1068e5 (patch)
tree9ecafe2c7d868924f53deb7eea3c6b3c02022453 /mbbsd/bbs.c
parenta309c14cf950a6b672485eec05eb05a827c8b27d (diff)
downloadpttbbs-8f6ded91d13206bfd09c68f8f6513e45eb1068e5.tar
pttbbs-8f6ded91d13206bfd09c68f8f6513e45eb1068e5.tar.gz
pttbbs-8f6ded91d13206bfd09c68f8f6513e45eb1068e5.tar.bz2
pttbbs-8f6ded91d13206bfd09c68f8f6513e45eb1068e5.tar.lz
pttbbs-8f6ded91d13206bfd09c68f8f6513e45eb1068e5.tar.xz
pttbbs-8f6ded91d13206bfd09c68f8f6513e45eb1068e5.tar.zst
pttbbs-8f6ded91d13206bfd09c68f8f6513e45eb1068e5.zip
fix 'stone article'
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@687 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 0587a5ee..2d498b59 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1,4 +1,4 @@
-/* $Id: bbs.c,v 1.79 2003/02/12 05:22:31 victor Exp $ */
+/* $Id: bbs.c,v 1.80 2003/03/05 10:42:03 victor Exp $ */
#include "bbs.h"
static void
@@ -699,9 +699,7 @@ reply_post(int ent, fileheader_t * fhdr, char *direct)
static int
edit_post(int ent, fileheader_t * fhdr, char *direct)
{
- char fpath[80], fpath0[80];
char genbuf[200];
- fileheader_t postfile;
boardheader_t *bp;
bp = getbcache(currbid);
if (strcmp(bp->brdname, "Security") == 0)
@@ -720,37 +718,28 @@ edit_post(int ent, fileheader_t * fhdr, char *direct)
setutmpmode(REEDIT);
setdirpath(genbuf, direct, fhdr->filename);
local_article = fhdr->filemode & FILE_LOCAL;
- strlcpy(save_title, fhdr->title, sizeof(save_title));
/* rocker.011018: 這裡是不是該檢查一下修改文章後的money和原有的比較? */
if (vedit(genbuf, 0, NULL) != -1) {
lock_substitute_record(direct, fhdr, sizeof(*fhdr), ent, LOCK_EX);
- setbpath(fpath, currboard);
- stampfile(fpath, &postfile);
- unlink(fpath);
- setbfile(fpath0, currboard, fhdr->filename);
-
- Rename(fpath0, fpath);
/* rocker.011018: fix 串接模式改文章後文章就不見的bug */
if ((currmode & MODE_SELECT) && (fhdr->money & FHR_REFERENCE)) {
fileheader_t hdr;
+ char fpath[80];
int num;
num = fhdr->money & ~FHR_REFERENCE;
- setbdir(fpath0, currboard);
- get_record(fpath0, &hdr, sizeof(hdr), num);
+ setbdir(fpath, currboard);
+ get_record(fpath, &hdr, sizeof(hdr), num);
/* 再這裡要check一下原來的dir裡面是不是有被人動過... */
if (!strcmp(hdr.filename, fhdr->filename)) {
- strlcpy(hdr.filename, postfile.filename, sizeof(hdr.filename));
+ strlcpy(hdr.filename, fhdr->filename, sizeof(hdr.filename));
strlcpy(hdr.title, save_title, sizeof(hdr.title));
- substitute_record(fpath0, &hdr, sizeof(hdr), num);
+ substitute_record(fpath, &hdr, sizeof(hdr), num);
}
}
- strlcpy(fhdr->filename, postfile.filename, sizeof(fhdr->filename));
- strlcpy(fhdr->title, save_title, sizeof(fhdr->title));
- brc_addlist(postfile.filename);
lock_substitute_record(direct, fhdr, sizeof(*fhdr), ent, LOCK_UN);
/* rocker.011018: 順便更新一下cache */
touchdircache(currbid);