diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-09-04 11:57:37 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-09-04 11:57:37 +0800 |
commit | 1519bd7f94f6096595d833b55d66b98c381dec9a (patch) | |
tree | 602df753f4c597c4fd3d652effd30d8f27c4ca1f | |
parent | 1d79f93affaf93c29cdc89bcc123441d04c1496d (diff) | |
download | pttbbs-1519bd7f94f6096595d833b55d66b98c381dec9a.tar pttbbs-1519bd7f94f6096595d833b55d66b98c381dec9a.tar.gz pttbbs-1519bd7f94f6096595d833b55d66b98c381dec9a.tar.bz2 pttbbs-1519bd7f94f6096595d833b55d66b98c381dec9a.tar.lz pttbbs-1519bd7f94f6096595d833b55d66b98c381dec9a.tar.xz pttbbs-1519bd7f94f6096595d833b55d66b98c381dec9a.tar.zst pttbbs-1519bd7f94f6096595d833b55d66b98c381dec9a.zip |
partially fix #35
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3128 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/proto.h | 2 | ||||
-rw-r--r-- | mbbsd/friend.c | 12 | ||||
-rw-r--r-- | mbbsd/mbbsd.c | 12 |
3 files changed, 17 insertions, 9 deletions
diff --git a/include/proto.h b/include/proto.h index 4c0003d2..195f0232 100644 --- a/include/proto.h +++ b/include/proto.h @@ -368,7 +368,7 @@ void mkuserdir(const char *userid); void log_usies(const char *mode, const char *mesg); void system_abort(void); void abort_bbs(int sig) GCC_NORETURN; -void del_distinct(const char *fname, const char *line); +void del_distinct(const char *fname, const char *line, int casesensitive); void add_distinct(const char *fname, const char *line); void u_exit(const char *mode); void talk_request(int sig); diff --git a/mbbsd/friend.c b/mbbsd/friend.c index 179a0482..f9945253 100644 --- a/mbbsd/friend.c +++ b/mbbsd/friend.c @@ -340,8 +340,10 @@ friend_edit(int type) dirty = 0; while (1) { stand_title(friend_list[type]); + /* TODO move (0, 40) just won't really work as it hints. + * The ANSI secapes will change x coordinate. */ move(0, 40); - prints("(名單上限:%d個人)", friend_max[type]); + prints("(名單上限: %d 人)", friend_max[type]); count = 0; CreateNameList(); @@ -364,8 +366,8 @@ friend_edit(int type) } getdata(1, 0, (count ? "(A)增加(D)刪除(E)修改(P)引入(L)詳細列出" - "(K)刪除整個名單(W)丟水球(Q)結束?[Q]" : - "(A)增加 (P)引入其他名單 (Q)結束?[Q]"), + "(K)刪除整個名單(W)丟水球(Q)結束?[Q] " : + "(A)增加 (P)引入其他名單 (Q)結束?[Q] "), uident, 3, LCECHO); if (uident[0] == 'a') { move(1, 0); @@ -393,7 +395,7 @@ friend_edit(int type) } else if (uident[0] == 'l' && count) more(fpath, YEA); else if (uident[0] == 'k' && count) { - getdata(2, 0, "整份名單將會被刪除,您確定嗎 (a/N)?", uident, 3, + getdata(2, 0, "刪除整份名單,確定嗎 (a/N)?", uident, 3, LCECHO); if (uident[0] == 'a') unlink(fpath); @@ -420,7 +422,7 @@ friend_edit(int type) sscanf(line, "%" toSTR(IDLEN) "s", uident); sethomefile(genbuf, uident, type == FRIEND_ALOHA ? "aloha" : "postnotify"); - del_distinct(genbuf, cuser.userid); + del_distinct(genbuf, cuser.userid, 0); } fclose(fp); } diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 30ba77ac..cb783a6c 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -718,7 +718,7 @@ add_distinct(const char *fname, const char *line) } void -del_distinct(const char *fname, const char *line) +del_distinct(const char *fname, const char *line, int casesensitive) { FILE *fp; int n = 0; @@ -740,8 +740,14 @@ del_distinct(const char *fname, const char *line) if (p[-1] == '\n' || p[-1] == '\r') p[-1] = 0; - if (!strcmp(buffer, line)) - break; + if(casesensitive) + { + if (!strcmp(buffer, line)) + break; + } else { + if (!strcasecmp(buffer, line)) + break; + } sscanf(buffer + strlen(buffer) + 2, "%d", &n); fprintf(fptmp, "%s%c#%d\n", buffer, 0, n); } |