diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-12-15 17:53:37 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-12-15 17:53:37 +0800 |
commit | 6cd1e2dd9904da07992c18b77f0586a4d77b61de (patch) | |
tree | f0262f726c6a3fba2f7fadaea15b9c31d34d6e0b /mbbsd/record.c | |
parent | c7179929b7a8a7e56abb07d57fd9e7936a2ca16e (diff) | |
download | pttbbs-6cd1e2dd9904da07992c18b77f0586a4d77b61de.tar pttbbs-6cd1e2dd9904da07992c18b77f0586a4d77b61de.tar.gz pttbbs-6cd1e2dd9904da07992c18b77f0586a4d77b61de.tar.bz2 pttbbs-6cd1e2dd9904da07992c18b77f0586a4d77b61de.tar.lz pttbbs-6cd1e2dd9904da07992c18b77f0586a4d77b61de.tar.xz pttbbs-6cd1e2dd9904da07992c18b77f0586a4d77b61de.tar.zst pttbbs-6cd1e2dd9904da07992c18b77f0586a4d77b61de.zip |
add SAFE_ARTICLE_DELETE,
when using 'd' to delete an article,
do not truncate .DIR immediately but add an empty record into the same place.
this avoids many problems.
(not complete yet)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1407 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/record.c')
-rw-r--r-- | mbbsd/record.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mbbsd/record.c b/mbbsd/record.c index e4c2897f..c28a0c6d 100644 --- a/mbbsd/record.c +++ b/mbbsd/record.c @@ -400,6 +400,19 @@ int delete_files(char *dirname, int (*filecheck) (), int record){ return ans; } +#ifdef SAFE_ARTICLE_DELETE +int +safe_article_delete(int ent, fileheader_t *fhdr, char *direct) +{ + fileheader_t newfhdr; + memcpy(&newfhdr, fhdr, sizeof(fileheader_t)); + sprintf(newfhdr.title, "(本文已被刪除)"); + strcpy(newfhdr.filename, ".deleted"); + substitute_record(direct, &newfhdr, sizeof(newfhdr), ent); + return 0; +} +#endif + int delete_file(char *dirname, int size, int ent, int (*filecheck) ()) { |