diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-12-22 10:49:06 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-12-22 10:49:06 +0800 |
commit | fe54b6d2f8bb76b1f24a80c84fc85fc6da47d2ae (patch) | |
tree | df79ed5de446a13948a69979fd18ed77686d1d72 /mbbsd/mbbsd.c | |
parent | 3de97b6c59cd333758305445294256b8868ae587 (diff) | |
download | pttbbs-fe54b6d2f8bb76b1f24a80c84fc85fc6da47d2ae.tar pttbbs-fe54b6d2f8bb76b1f24a80c84fc85fc6da47d2ae.tar.gz pttbbs-fe54b6d2f8bb76b1f24a80c84fc85fc6da47d2ae.tar.bz2 pttbbs-fe54b6d2f8bb76b1f24a80c84fc85fc6da47d2ae.tar.lz pttbbs-fe54b6d2f8bb76b1f24a80c84fc85fc6da47d2ae.tar.xz pttbbs-fe54b6d2f8bb76b1f24a80c84fc85fc6da47d2ae.tar.zst pttbbs-fe54b6d2f8bb76b1f24a80c84fc85fc6da47d2ae.zip |
fix Ptt_prints bug
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1422 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r-- | mbbsd/mbbsd.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 1b932dad..c0455df1 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -510,8 +510,8 @@ inline static void mkuserdir(char *userid) static void login_query() { -#ifdef GB_CONVERT - /* uid 加一位, for gb login */ +#ifdef CONVERT + /* uid 加一位, for converting login */ char uid[IDLEN + 2], passbuf[PASSLEN]; int attempts, len; #else @@ -545,11 +545,15 @@ login_query() getdata(20, 0, "請輸入代號,或以[guest]參觀,以[new]註冊:", uid, sizeof(uid), DOECHO); -#ifdef GB_CONVERT +#ifdef CONVERT /* switch to gb mode if uid end with '.' */ len = strlen(uid); if (uid[0] && uid[len - 1] == '.') { - set_converting_type(1); + set_converting_type(GBCONVERT); + uid[len - 1] = 0; + } + else if (uid[0] && uid[len - 1] == ',') { + set_converting_type(UCSCONVERT); uid[len - 1] = 0; } else if (len >= IDLEN + 1) @@ -1258,6 +1262,12 @@ main(int argc, char *argv[], char *envp[]) signal(SIGUSR2, SIG_IGN); attach_SHM(); +#ifdef CONVERT +/* initiate the converting object before fork() + * to avoid copy on write each time */ + ucs_converting_init(); +#endif + if( (argc == 3 && shell_login(argc, argv, envp)) || (argc != 3 && daemon_login(argc, argv, envp)) ) start_client(); |