diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-06-10 03:32:29 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-06-10 03:32:29 +0800 |
commit | bdc87f99f91971140d7026106b467ac29c76e6eb (patch) | |
tree | 7ecebfc542b786e6cc0eea5878662351079be0e9 | |
parent | bc230589951eeb8c8e476d92a3d39b319f543427 (diff) | |
download | pttbbs-bdc87f99f91971140d7026106b467ac29c76e6eb.tar pttbbs-bdc87f99f91971140d7026106b467ac29c76e6eb.tar.gz pttbbs-bdc87f99f91971140d7026106b467ac29c76e6eb.tar.bz2 pttbbs-bdc87f99f91971140d7026106b467ac29c76e6eb.tar.lz pttbbs-bdc87f99f91971140d7026106b467ac29c76e6eb.tar.xz pttbbs-bdc87f99f91971140d7026106b467ac29c76e6eb.tar.zst pttbbs-bdc87f99f91971140d7026106b467ac29c76e6eb.zip |
code clean up
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3538 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/brc.c | 15 | ||||
-rw-r--r-- | mbbsd/mbbsd.c | 2 |
2 files changed, 2 insertions, 15 deletions
diff --git a/mbbsd/brc.c b/mbbsd/brc.c index 2f1639d0..8c4b86da 100644 --- a/mbbsd/brc.c +++ b/mbbsd/brc.c @@ -447,20 +447,9 @@ brc_unread_time(time4_t ftime, int bnum, const time4_t *blist) int brc_unread(const char *fname, int bnum, const time4_t *blist) { - int ftime, n; + int ftime; ftime = atoi(&fname[2]); /* this will get the time of the file created */ - if (ftime <= brc_expire_time) /* too old */ - return 0; - - if (bnum <= 0) - return 1; - for (n = 0; n < bnum; n++) { /* using linear search */ - if (ftime > blist[n]) - return 1; - else if (ftime == blist[n]) - return 0; - } - return 0; + return brc_unread_time(ftime, bnum, blist); } diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 487641fb..4b48afa4 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -818,7 +818,6 @@ add_distinct(const char *fname, const char *line) } fclose(fp); fclose(fptmp); - unlink(fname); rename(tmpname, fname); } } @@ -865,7 +864,6 @@ del_distinct(const char *fname, const char *line, int casesensitive) } fclose(fp); fclose(fptmp); - unlink(fname); rename(tmpname, fname); } } |