summaryrefslogtreecommitdiffstats
path: root/mbbsd/board.c
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-11-08 12:15:25 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-11-08 12:15:25 +0800
commit1cbd90b655b5ae3ca704838f24dbb73ab61201e4 (patch)
treee644ab8ad80e121d456e7a8d18a39cf33c0a20d3 /mbbsd/board.c
parent5f5c02f9f73dadb4b4dc10195cde772c3c956205 (diff)
downloadpttbbs-1cbd90b655b5ae3ca704838f24dbb73ab61201e4.tar
pttbbs-1cbd90b655b5ae3ca704838f24dbb73ab61201e4.tar.gz
pttbbs-1cbd90b655b5ae3ca704838f24dbb73ab61201e4.tar.bz2
pttbbs-1cbd90b655b5ae3ca704838f24dbb73ab61201e4.tar.lz
pttbbs-1cbd90b655b5ae3ca704838f24dbb73ab61201e4.tar.xz
pttbbs-1cbd90b655b5ae3ca704838f24dbb73ab61201e4.tar.zst
pttbbs-1cbd90b655b5ae3ca704838f24dbb73ab61201e4.zip
warn before 'Z'
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1305 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/board.c')
-rw-r--r--mbbsd/board.c49
1 files changed, 27 insertions, 22 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c
index 778f1ed8..fe84ce3a 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -1389,35 +1389,40 @@ choose_board(int newflag)
vmsg("糑糑 硂\竒砆и程稲奔翅!");
break;
case 'Z':
- if (!HAS_PERM(PERM_BASIC))
- break;
- cuser.uflag2 ^= FAVNEW_FLAG;
- if(cuser.uflag2 & FAVNEW_FLAG){
- char fname[80];
+ if (HAS_PERM(PERM_BASIC)) {
+ char genbuf[256];
+ sprintf(genbuf, "絋﹚璶 %s璹綷 穝狾? [N/y] ", cuser.uflag2 & FAVNEW_FLAG ? "" : "");
+ if (getans(genbuf) != 'y')
+ break;
- setuserfile(fname, FAVNB);
+ cuser.uflag2 ^= FAVNEW_FLAG;
+ if(cuser.uflag2 & FAVNEW_FLAG){
+ char fname[80];
- if( (tmp = open(fname, O_RDONLY, 0600)) != -1 ){
- close(tmp);
- updatenewfav(0);
- }
- else{
- char stat;
- if( (tmp = open(fname, O_WRONLY | O_CREAT, 0600)) != -1 ){
- for(tmp1 = 0; tmp1 < numboards; tmp1++){
- if(bcache[tmp1].brdname[0] && Ben_Perm(&bcache[tmp1]))
- stat = BRD_OLD;
- else
- stat = BRD_NEW;
+ setuserfile(fname, FAVNB);
+
+ if( (tmp = open(fname, O_RDONLY, 0600)) != -1 ){
+ close(tmp);
+ updatenewfav(0);
+ }
+ else{
+ char stat;
+ if( (tmp = open(fname, O_WRONLY | O_CREAT, 0600)) != -1 ){
+ for(tmp1 = 0; tmp1 < numboards; tmp1++){
+ if(bcache[tmp1].brdname[0] && Ben_Perm(&bcache[tmp1]))
+ stat = BRD_OLD;
+ else
+ stat = BRD_NEW;
+ write(tmp, &stat, sizeof(char));
+ }
+ stat = BRD_END;
write(tmp, &stat, sizeof(char));
+ close(tmp);
}
- stat = BRD_END;
- write(tmp, &stat, sizeof(char));
- close(tmp);
}
}
+ vmsg((cuser.uflag2 & FAVNEW_FLAG) ? "ち传璹綷\穝狾家Α" : "ち传タ盽家Α");
}
- vmsg((cuser.uflag2 & FAVNEW_FLAG) ? "ち传璹綷\穝狾家Α" : "ち传タ盽家Α");
break;
case 'v':
case 'V':