diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-11-08 12:15:25 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-11-08 12:15:25 +0800 |
commit | be6d54efc1cf5dc4f3b94b5fdefc63075577020e (patch) | |
tree | 08f5b684f0ac4322b0f25a49154e2424dc8a22ef | |
parent | c4897ea3451703d026cbe04a7fc60113786f621f (diff) | |
download | pttbbs-be6d54efc1cf5dc4f3b94b5fdefc63075577020e.tar pttbbs-be6d54efc1cf5dc4f3b94b5fdefc63075577020e.tar.gz pttbbs-be6d54efc1cf5dc4f3b94b5fdefc63075577020e.tar.bz2 pttbbs-be6d54efc1cf5dc4f3b94b5fdefc63075577020e.tar.lz pttbbs-be6d54efc1cf5dc4f3b94b5fdefc63075577020e.tar.xz pttbbs-be6d54efc1cf5dc4f3b94b5fdefc63075577020e.tar.zst pttbbs-be6d54efc1cf5dc4f3b94b5fdefc63075577020e.zip |
warn before 'Z'
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@1305 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/board.c | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/pttbbs/mbbsd/board.c b/pttbbs/mbbsd/board.c index 778f1ed8..fe84ce3a 100644 --- a/pttbbs/mbbsd/board.c +++ b/pttbbs/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': |