summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2011-03-21 20:29:45 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2011-03-21 20:29:45 +0800
commit6764dd3ca76882ca4aeda18df88d2f6ac098995d (patch)
tree77de6d6475897089e4ada1fd7156e0473a3d770d
parent44ecf3584cf9642149e04276e691db505d5e565f (diff)
downloadpttbbs-6764dd3ca76882ca4aeda18df88d2f6ac098995d.tar
pttbbs-6764dd3ca76882ca4aeda18df88d2f6ac098995d.tar.gz
pttbbs-6764dd3ca76882ca4aeda18df88d2f6ac098995d.tar.bz2
pttbbs-6764dd3ca76882ca4aeda18df88d2f6ac098995d.tar.lz
pttbbs-6764dd3ca76882ca4aeda18df88d2f6ac098995d.tar.xz
pttbbs-6764dd3ca76882ca4aeda18df88d2f6ac098995d.tar.zst
pttbbs-6764dd3ca76882ca4aeda18df88d2f6ac098995d.zip
solve: non-exist file can't be re-edited.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5325 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/bbs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index 5c849843..da1c1202 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -1673,12 +1673,17 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct)
(int)now, Cdate(&now), getpid(), cuser.userid, fpath);
}
+ setdirpath(genbuf, direct, fhdr->filename);
+ if (!dashf(genbuf)) {
+ vmsg("此檔已損毀,無法編輯。您可以試著刪除它。");
+ return FULLUPDATE;
+ }
+
edflags = EDITFLAG_ALLOWTITLE;
edflags = solveEdFlagByBoard(bp->brdname, edflags);
setutmpmode(REEDIT);
-
// TODO 由於現在檔案都是直接蓋回原檔,
// 在原看板目錄開已沒有很大意義。 (效率稍高一點)
// 可以考慮改開在 user home dir
@@ -1689,7 +1694,6 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct)
// XXX 以現在的模式,這是個 temp file
stampfile(fpath, &postfile);
- setdirpath(genbuf, direct, fhdr->filename);
local_article = fhdr->filemode & FILE_LOCAL;
// copying takes long time, add some visual effect