summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-28 03:35:13 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-28 03:35:13 +0800
commite608be6d6619a2a3d9371511ecc127c216349191 (patch)
tree8ac267296e2386949bd66aa04e10bac7c49e2ba2
parentc95e0fe9deb9628ea33675485f668d81c6e485c5 (diff)
downloadpttbbs-e608be6d6619a2a3d9371511ecc127c216349191.tar
pttbbs-e608be6d6619a2a3d9371511ecc127c216349191.tar.gz
pttbbs-e608be6d6619a2a3d9371511ecc127c216349191.tar.bz2
pttbbs-e608be6d6619a2a3d9371511ecc127c216349191.tar.lz
pttbbs-e608be6d6619a2a3d9371511ecc127c216349191.tar.xz
pttbbs-e608be6d6619a2a3d9371511ecc127c216349191.tar.zst
pttbbs-e608be6d6619a2a3d9371511ecc127c216349191.zip
get ride of delete_file
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1618 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/bbs.c8
-rw-r--r--mbbsd/mail.c4
-rw-r--r--mbbsd/record.c3
3 files changed, 8 insertions, 7 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index d2f15454..2047b351 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1807,8 +1807,8 @@ del_range(int ent, fileheader_t *fhdr, char *direct)
break;
now = getindex(genbuf, rsfh.filename, size);
strlcpy(currfile, rsfh.filename, sizeof(currfile));
- delete_file(genbuf, sizeof(fileheader_t), now,
- cmpfilename);
+ delete_record(genbuf, sizeof(fileheader_t), now);
+ // cmpfilename);
i++;
}
}
@@ -1862,7 +1862,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
#ifdef SAFE_ARTICLE_DELETE
!safe_article_delete(ent, fhdr, direct)
#else
- !delete_file(direct, sizeof(fileheader_t), ent, cmpfilename)
+ !delete_record(direct, sizeof(fileheader_t), ent)
#endif
) {
int num;
@@ -1883,7 +1883,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
}
/* rocker.011018: 這裡要還原被破壞的money */
fhdr->money = hdr.money;
- delete_file(genbuf, sizeof(fileheader_t), num, cmpfilename);
+ delete_record(genbuf, sizeof(fileheader_t), num);
}
cancelpost(fhdr, not_owned, newpath);
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index 2d21d3ad..506de43a 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -869,14 +869,14 @@ mail_del(int ent, fileheader_t * fhdr, char *direct)
getdata(1, 0, msg_del_ny, genbuf, 3, LCECHO);
if (genbuf[0] == 'y') {
strlcpy(currfile, fhdr->filename, sizeof(currfile));
- if (!delete_file(direct, sizeof(*fhdr), ent, cmpfilename)) {
+ if (!delete_record(direct, sizeof(*fhdr), ent)) {
setdirpath(genbuf, direct, fhdr->filename);
unlink(genbuf);
if ((currmode & MODE_SELECT)) {
int index;
sethomedir(genbuf, cuser.userid);
index = getindex(genbuf, fhdr->filename, sizeof(fileheader_t));
- delete_file(genbuf, sizeof(fileheader_t), index, cmpfilename);
+ delete_record(genbuf, sizeof(fileheader_t), index);
}
return DIRCHANGED;
}
diff --git a/mbbsd/record.c b/mbbsd/record.c
index 0216fa45..dd543f77 100644
--- a/mbbsd/record.c
+++ b/mbbsd/record.c
@@ -415,7 +415,6 @@ safe_article_delete_range(char *direct, int from, int to)
}
return 0;
}
-#endif
int
delete_file(char *dirname, int size, int ent, int (*filecheck) ())
@@ -477,6 +476,8 @@ delete_file(char *dirname, int size, int ent, int (*filecheck) ())
return -1;
}
+#endif
+
#endif /* !defined(_BBS_UTIL_C_) */
int apply_record(char *fpath, int (*fptr) (), int size){