diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 13 | ||||
-rw-r--r-- | mbbsd/announce.c | 10 | ||||
-rw-r--r-- | mbbsd/cache.c | 6 | ||||
-rw-r--r-- | mbbsd/gamble.c | 4 | ||||
-rw-r--r-- | mbbsd/record.c | 6 | ||||
-rw-r--r-- | mbbsd/stuff.c | 12 | ||||
-rw-r--r-- | mbbsd/syspost.c | 14 | ||||
-rw-r--r-- | mbbsd/user.c | 6 | ||||
-rw-r--r-- | mbbsd/vote.c | 6 |
9 files changed, 39 insertions, 38 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 54fb017f..04804809 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -1,4 +1,4 @@ -/* $Id: admin.c,v 1.2 2002/03/07 16:44:18 in2 Exp $ */ +/* $Id: admin.c,v 1.3 2002/03/09 17:27:57 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -241,8 +241,8 @@ int m_mod_board(char *bname) { if(HAS_PERM(PERM_SYSOP) ) { char actionbuf[512]; - sprintf(actionbuf, BBSHOME "/bin/buildir boards/%s &", - bh.brdname); + sprintf(actionbuf, BBSHOME "/bin/buildir boards/%c/%s &", + bh.brdname[0], bh.brdname); system(actionbuf); } break; @@ -284,9 +284,10 @@ int m_mod_board(char *bname) { else { strcpy(bname, bh.brdname); sprintf(genbuf, - "/bin/tar zcvf tmp/board_%s.tgz boards/%s man/%s >/dev/null 2>&1;" - "/bin/rm -fr boards/%s man/%s", - bname, bname, bname, bname, bname); + "/bin/tar zcvf tmp/board_%s.tgz boards/%c/%s man/boards/%c/%s >/dev/null 2>&1;" + "/bin/rm -fr boards/%c/%s man/boards/%c/%s", + bname, bname[0], bname, bname[0], + bname, bname[0], bname, bname[0], bname); system(genbuf); memset(&bh, 0, sizeof(bh)); sprintf(bh.title, "%s 看板 %s 刪除", bname, cuser.userid); diff --git a/mbbsd/announce.c b/mbbsd/announce.c index 960a45aa..0cbce01e 100644 --- a/mbbsd/announce.c +++ b/mbbsd/announce.c @@ -1,4 +1,4 @@ -/* $Id: announce.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */ +/* $Id: announce.c,v 1.2 2002/03/09 17:27:57 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -805,12 +805,12 @@ static void a_newitem(menu_t *pm, int mode) { for(d = 0; d <= 3; d++) { switch(d) { case 0: - sprintf(lpath, "%s%s%s/%s", - BBSHOME, "/man/boards/",currboard , buf); + sprintf(lpath, BBSHOME "/man/boards/%c/%s/%s", + currboard[0], currboard, buf); break; case 1: - sprintf(lpath, "%s%s%s", - BBSHOME, "/man/boards/" , buf); + sprintf(lpath, "%s%s/%c/%s", + BBSHOME, "/man/boards/" , buf[0], buf); break; case 2: sprintf(lpath, "%s%s%s", diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 73f8ac5b..57ed0d3f 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -1,4 +1,4 @@ -/* $Id: cache.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */ +/* $Id: cache.c,v 1.2 2002/03/09 17:27:57 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -63,7 +63,7 @@ unsigned int safe_sleep(unsigned int seconds) { #if defined(_BBS_UTIL_C_) static void setapath(char *buf, char *boardname) { - sprintf(buf, "man/boards/%s", boardname); + sprintf(buf, "man/boards/%c/%s", boardname[0], boardname); } static char *str_dotdir = ".DIR"; @@ -758,7 +758,7 @@ void setbtotal(int bid) { char genbuf[256]; int num,fd; - sprintf(genbuf, "boards/%s/.DIR", bh->brdname); + sprintf(genbuf, "boards/%c/%s/.DIR", bh->brdname[0], bh->brdname); if((fd = open(genbuf, O_RDWR)) < 0) return; /* .DIR掛了 */ diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c index 23867450..a2fc3c37 100644 --- a/mbbsd/gamble.c +++ b/mbbsd/gamble.c @@ -1,4 +1,4 @@ -/* $Id: gamble.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */ +/* $Id: gamble.c,v 1.2 2002/03/09 17:27:57 in2 Exp $ */ #include <stdio.h> #include <time.h> #include <string.h> @@ -32,7 +32,7 @@ int post_msg(char* bname, char* title, char *msg, char* author) char genbuf[256]; /* 在 bname 版發表新文章 */ - sprintf(genbuf, "boards/%s", bname); + sprintf(genbuf, "boards/%c/%s", bname[0], bname); stampfile(genbuf, &fhdr); fp = fopen(genbuf,"w"); diff --git a/mbbsd/record.c b/mbbsd/record.c index 59bc6a75..321132f3 100644 --- a/mbbsd/record.c +++ b/mbbsd/record.c @@ -1,4 +1,4 @@ -/* $Id: record.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */ +/* $Id: record.c,v 1.2 2002/03/09 17:27:57 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <errno.h> @@ -301,9 +301,9 @@ int delete_files(char* dirname, int (*filecheck)(), int record) { char genbuf[256]; char deleted[256]; fileheader_t delfh; - char deletedDIR[] = "boards/deleted/.DIR"; + char deletedDIR[] = "boards/d/deleted/.DIR"; - strcpy(deleted, "boards/deleted"); + strcpy(deleted, "boards/d/deleted"); if(!(fp = fopen(dirname, "r"))) return ans; diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 9218b7f0..cede4a9d 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -1,4 +1,4 @@ -/* $Id: stuff.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */ +/* $Id: stuff.c,v 1.2 2002/03/09 17:27:57 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -26,7 +26,7 @@ extern userec_t cuser; /* set file path for boards/user home */ /* ----------------------------------------------------- */ static char *str_home_file = "home/%c/%s/%s"; -static char *str_board_file = "boards/%s/%s"; +static char *str_board_file = "boards/%c/%s/%s"; #define STR_DOTDIR ".DIR" static char *str_dotdir = STR_DOTDIR; @@ -56,7 +56,7 @@ void setuserfile(char *buf, char *fname) { } void setapath(char *buf, char *boardname) { - sprintf(buf, "man/boards/%s", boardname); + sprintf(buf, "man/boards/%c/%s", boardname[0], boardname); } void setadir(char *buf, char *path) { @@ -64,17 +64,17 @@ void setadir(char *buf, char *path) { } void setbpath(char *buf, char *boardname) { - sprintf(buf, "boards/%s", boardname); + sprintf(buf, "boards/%c/%s", boardname[0], boardname); } void setbdir(char *buf, char *boardname) { - sprintf(buf, str_board_file, boardname, + sprintf(buf, str_board_file, boardname[0], boardname, currmode & MODE_ETC ? ".ETC" : (currmode & MODE_DIGEST ? fn_mandex : str_dotdir)); } void setbfile(char *buf, char *boardname, char *fname) { - sprintf(buf, str_board_file, boardname, fname); + sprintf(buf, str_board_file, boardname[0], boardname, fname); } void setdirpath(char *buf, char *direct, char *fname) { diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c index b7aefe10..67edc632 100644 --- a/mbbsd/syspost.c +++ b/mbbsd/syspost.c @@ -1,4 +1,4 @@ -/* $Id: syspost.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */ +/* $Id: syspost.c,v 1.2 2002/03/09 17:27:57 in2 Exp $ */ #include <stdio.h> #include <string.h> #include <time.h> @@ -19,7 +19,7 @@ void post_change_perm(int oldperm, int newperm, char *sysopid, char *userid) { char genbuf[200], reason[30]; int i, flag=0; - strcpy(genbuf, "boards/Security"); + strcpy(genbuf, "boards/S/Security"); stampfile(genbuf, &fhdr); if(!(fp = fopen(genbuf,"w"))) return; @@ -49,7 +49,7 @@ void post_change_perm(int oldperm, int newperm, char *sysopid, char *userid) { sprintf(fhdr.title, "[公安報告] 站長%s修改%s權限報告", cuser.userid, userid); strcpy(fhdr.owner, "[系統安全局]"); - append_record("boards/Security/.DIR", &fhdr, sizeof(fhdr)); + append_record("boards/S/Security/.DIR", &fhdr, sizeof(fhdr)); } } @@ -58,7 +58,7 @@ void post_violatelaw(char* crime, char* police, char* reason, char* result){ fileheader_t fhdr; time_t now; FILE *fp; - strcpy(genbuf, "boards/Security"); + strcpy(genbuf, "boards/S/Security"); stampfile(genbuf, &fhdr); if(!(fp = fopen(genbuf,"w"))) return; @@ -72,9 +72,9 @@ void post_violatelaw(char* crime, char* police, char* reason, char* result){ fclose(fp); sprintf(fhdr.title, "[報告] %-20s 違法判決報告", crime); strcpy(fhdr.owner, "[Ptt法院]"); - append_record("boards/Security/.DIR", &fhdr, sizeof(fhdr)); + append_record("boards/S/Security/.DIR", &fhdr, sizeof(fhdr)); - strcpy(genbuf, "boards/ViolateLaw"); + strcpy(genbuf, "boards/V/ViolateLaw"); stampfile(genbuf, &fhdr); if(!(fp = fopen(genbuf,"w"))) return; @@ -89,7 +89,7 @@ void post_violatelaw(char* crime, char* police, char* reason, char* result){ sprintf(fhdr.title, "[報告] %-20s 違法判決報告", crime); strcpy(fhdr.owner, "[Ptt法院]"); - append_record("boards/ViolateLaw/.DIR", &fhdr, sizeof(fhdr)); + append_record("boards/V/ViolateLaw/.DIR", &fhdr, sizeof(fhdr)); } diff --git a/mbbsd/user.c b/mbbsd/user.c index 41aacfa9..72850ad7 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -1,4 +1,4 @@ -/* $Id: user.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */ +/* $Id: user.c,v 1.2 2002/03/09 17:27:57 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -519,7 +519,7 @@ void uinfo_query(userec_t *u, int real, int unum) { passwd_update(unum, &x); now = time(0); if(money_change) { - strcpy(genbuf, "boards/Security"); + strcpy(genbuf, "boards/S/Security"); stampfile(genbuf, &fhdr); if(!(fp = fopen(genbuf,"w"))) return; @@ -542,7 +542,7 @@ void uinfo_query(userec_t *u, int real, int unum) { sprintf(fhdr.title, "[公安報告] 站長%s修改%s錢報告", cuser.userid, x.userid); strcpy(fhdr.owner, "[系統安全局]"); - append_record("boards/Security/.DIR", &fhdr, sizeof(fhdr)); + append_record("boards/S/Security/.DIR", &fhdr, sizeof(fhdr)); } } } diff --git a/mbbsd/vote.c b/mbbsd/vote.c index 62916c99..b16857ce 100644 --- a/mbbsd/vote.c +++ b/mbbsd/vote.c @@ -1,4 +1,4 @@ -/* $Id: vote.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */ +/* $Id: vote.c,v 1.2 2002/03/09 17:27:57 in2 Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -281,10 +281,10 @@ static void b_result_one(boardheader_t *fh, int ind) { b_suckinfile(frp, b_newresults); fclose(frp); } - sprintf(inbuf, "boards/%s", bname); + sprintf(inbuf, "boards/%c/%s", bname[0], bname); vote_report(bname, b_report, inbuf); if(!(fh->brdattr &BRD_NOCOUNT)) { - sprintf(inbuf, "boards/%s", "Record"); + sprintf(inbuf, "boards/%c/%s", 'R', "Record"); vote_report(bname, b_report, inbuf); } unlink(b_report); |