diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-11 14:16:49 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-11 14:16:49 +0800 |
commit | 5c3bb0ce3bcbd99430b25b4d7ecfb474d4814947 (patch) | |
tree | 3b43100a6e3353744bf56a1e3497fdd53105ff18 | |
parent | 0c0ea6ce3de183926f174cf6622601bcfe2ccfd8 (diff) | |
download | pttbbs-5c3bb0ce3bcbd99430b25b4d7ecfb474d4814947.tar pttbbs-5c3bb0ce3bcbd99430b25b4d7ecfb474d4814947.tar.gz pttbbs-5c3bb0ce3bcbd99430b25b4d7ecfb474d4814947.tar.bz2 pttbbs-5c3bb0ce3bcbd99430b25b4d7ecfb474d4814947.tar.lz pttbbs-5c3bb0ce3bcbd99430b25b4d7ecfb474d4814947.tar.xz pttbbs-5c3bb0ce3bcbd99430b25b4d7ecfb474d4814947.tar.zst pttbbs-5c3bb0ce3bcbd99430b25b4d7ecfb474d4814947.zip |
- change hard coded .DIR to macro definitions
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3667 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/common.h | 1 | ||||
-rw-r--r-- | mbbsd/bbs.c | 2 | ||||
-rw-r--r-- | mbbsd/cache.c | 8 | ||||
-rw-r--r-- | mbbsd/mail.c | 2 | ||||
-rw-r--r-- | mbbsd/record.c | 2 | ||||
-rw-r--r-- | mbbsd/stuff.c | 3 | ||||
-rw-r--r-- | mbbsd/syspost.c | 2 | ||||
-rw-r--r-- | mbbsd/vote.c | 2 |
8 files changed, 11 insertions, 11 deletions
diff --git a/include/common.h b/include/common.h index 1bb27030..34b18bf0 100644 --- a/include/common.h +++ b/include/common.h @@ -16,6 +16,7 @@ #define FN_CANVOTE "can_vote" #define FN_VISABLE "visable" #define FN_USIES "usies" /* BBS log */ +#define FN_DIR ".DIR" #define FN_BOARD ".BRD" /* board list */ #define FN_USEBOARD "usboard" /* 看板統計 */ #define FN_NOTE_ANS "note.ans" diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index e32aecab..2528f49c 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -56,7 +56,7 @@ query_file_money(const fileheader_t *pfh) char genbuf[MAXPATHLEN]; /* it is assumed that in MODE_SELECT, currboard is selected. */ - setbfile(genbuf, currboard, ".DIR"); + setbfile(genbuf, currboard, FN_DIR); get_record(genbuf, &hdr, sizeof(hdr), pfh->multi.refer.ref); pfh = &hdr; } diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 881748cd..764aac72 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -596,7 +596,7 @@ reload_bcache(void) if( SHM->bcache[i].brdname[0] ){ char fn[128]; int n; - sprintf(fn, "boards/%c/%s/.DIR.bottom", + sprintf(fn, "boards/%c/%s/" FN_DIR ".bottom", SHM->bcache[i].brdname[0], SHM->bcache[i].brdname); n = get_num_records(fn, sizeof(fileheader_t)); @@ -689,7 +689,7 @@ setbottomtotal(int bid) assert(0<=bid-1 && bid-1<MAX_BOARD); if(!bh->brdname[0]) return; - setbfile(fname, bh->brdname, ".DIR.bottom"); + setbfile(fname, bh->brdname, FN_DIR ".bottom"); n = get_num_records(fname, sizeof(fileheader_t)); if(n>5) { @@ -711,7 +711,7 @@ setbtotal(int bid) int num, fd; assert(0<=bid-1 && bid-1<MAX_BOARD); - setbfile(genbuf, bh->brdname, ".DIR"); + setbfile(genbuf, bh->brdname, FN_DIR); if ((fd = open(genbuf, O_RDWR)) < 0) return; /* .DIR掛了 */ fstat(fd, &st); @@ -861,7 +861,7 @@ reload_pttcache(void) if ((fp = fopen(buf, "r"))) { while (fread(&item, sizeof(item), 1, fp)) { if (item.title[3] == '<' && item.title[8] == '>') { - snprintf(buf, sizeof(buf), "%s/%s/.DIR", + snprintf(buf, sizeof(buf), "%s/%s/" FN_DIR, pbuf, item.filename); if (!(fp1 = fopen(buf, "r"))) continue; diff --git a/mbbsd/mail.c b/mbbsd/mail.c index b7485c65..6c5e5efc 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -1834,7 +1834,7 @@ bsmtp(const char *fpath, const char *title, const char *rcpt) strlcpy(mqueue.username, cuser.nickname, sizeof(mqueue.username)); strlcpy(mqueue.rcpt, rcpt, sizeof(mqueue.rcpt)); - if (append_record("out/.DIR", (fileheader_t *) & mqueue, sizeof(mqueue)) < 0) + if (append_record("out/" FN_DIR, (fileheader_t *) & mqueue, sizeof(mqueue)) < 0) return 0; return chrono; } diff --git a/mbbsd/record.c b/mbbsd/record.c index c58b7ecc..d896398f 100644 --- a/mbbsd/record.c +++ b/mbbsd/record.c @@ -192,7 +192,7 @@ substitute_ref_record(const char *direct, fileheader_t * fhdr, int ent) /* rocker.011018: 串接模式用reference增進效率 */ if (!(fhdr->filemode & FILE_BOTTOM) && (fhdr->multi.refer.flag) && (num = fhdr->multi.refer.ref)){ - setdirpath(fname, direct, ".DIR"); + setdirpath(fname, direct, FN_DIR); get_record(fname, &hdr, sizeof(hdr), num); if (strcmp(hdr.filename, fhdr->filename)) { if((num = getindex_m(fname, fhdr, num, 1))>0) { diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 19049c8b..371583f4 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -11,8 +11,7 @@ static const char * const str_board_n_file = "boards/%c/%s/%s.%d"; static char cdate_buffer[32]; -#define STR_DOTDIR ".DIR" -static const char * const str_dotdir = STR_DOTDIR; +static const char * const str_dotdir = FN_DIR; /* XXX set*() all assume buffer size = PATHLEN */ void diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c index 92aec28a..da62db13 100644 --- a/mbbsd/syspost.c +++ b/mbbsd/syspost.c @@ -93,7 +93,7 @@ post_change_perm(int oldperm, int newperm, const char *sysopid, const char *user "[公安報告] 站長%s修改%s權限報告", cuser.userid, userid); strlcpy(fhdr.owner, "[系統安全局]", sizeof(fhdr.owner)); - append_record("boards/S/Security/.DIR", &fhdr, sizeof(fhdr)); + append_record("boards/S/Security/" FN_DIR, &fhdr, sizeof(fhdr)); } else fclose(fp); } diff --git a/mbbsd/vote.c b/mbbsd/vote.c index ce92c21f..0a91f3f2 100644 --- a/mbbsd/vote.c +++ b/mbbsd/vote.c @@ -151,7 +151,7 @@ vote_report(const char *bname, const char *fname, char *fpath) } strlcpy(header.filename, ip, sizeof(header.filename)); - strcpy(ip, ".DIR"); + strcpy(ip, FN_DIR); if ((fd = open(fpath, O_WRONLY | O_CREAT, 0644)) >= 0) { flock(fd, LOCK_EX); lseek(fd, 0, SEEK_END); |