summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-13 21:37:53 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-13 21:37:53 +0800
commit0775e9d20c61f23d895fc92a499a69e031a211c0 (patch)
treec61011915071f41a4f1b381684f1762ee91e8aae /mbbsd/bbs.c
parenta9bab13f9a1b4b90e727561da7b5f6bc1dd2dbe1 (diff)
downloadpttbbs-0775e9d20c61f23d895fc92a499a69e031a211c0.tar
pttbbs-0775e9d20c61f23d895fc92a499a69e031a211c0.tar.gz
pttbbs-0775e9d20c61f23d895fc92a499a69e031a211c0.tar.bz2
pttbbs-0775e9d20c61f23d895fc92a499a69e031a211c0.tar.lz
pttbbs-0775e9d20c61f23d895fc92a499a69e031a211c0.tar.xz
pttbbs-0775e9d20c61f23d895fc92a499a69e031a211c0.tar.zst
pttbbs-0775e9d20c61f23d895fc92a499a69e031a211c0.zip
simplify the code
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1750 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 07bc4159..dd631f1a 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -2324,14 +2324,10 @@ board_etc()
static int
push_bottom(int ent, fileheader_t * fhdr, char *direct)
{
- int num, i;
+ int num;
char buf[256];
if ((currmode & MODE_DIGEST) || !(currmode & MODE_BOARD))
return DONOTHING;
- if(strstr(direct, ".bottom"))
- strcpy(buf, direct);
- else
- sprintf(buf, "%s.bottom", direct);
num = getbottomtotal(currbid);
if(getans(fhdr->filemode & FILE_BOTTOM ?
"取消置底公告?(y/N)":
@@ -2339,6 +2335,7 @@ push_bottom(int ent, fileheader_t * fhdr, char *direct)
fhdr->filemode ^= FILE_BOTTOM;
if(fhdr->filemode & FILE_BOTTOM)
{
+ sprintf(buf, "%s.bottom", direct);
if(num >= 5)
{
vmsg("不得超過 5 篇重要公告 請精簡!");
@@ -2348,14 +2345,7 @@ push_bottom(int ent, fileheader_t * fhdr, char *direct)
}
else
{
- fileheader_t headers[5];
- if(num>5) num=5;
- num = get_records(buf, &headers, sizeof(fileheader_t), 1, num);
- for(i=0; i<num; i++)
- {
- if(!strcmp(fhdr->filename, headers[i].filename))
- delete_record(buf, sizeof(fileheader_t), i+1);
- }
+ num = delete_record(direct, sizeof(fileheader_t), ent);
}
setbottomtotal(currbid);
touchdircache(currbid);