--- sbbs/src/sbbs3/getkey.cpp 2018/04/24 16:41:23 1.1.1.1 +++ sbbs/src/sbbs3/getkey.cpp 2018/04/24 16:43:01 1.1.1.2 @@ -2,13 +2,13 @@ /* Synchronet single-key console functions */ -/* $Id: getkey.cpp,v 1.1.1.1 2018/04/24 16:41:23 root Exp $ */ +/* $Id: getkey.cpp,v 1.1.1.2 2018/04/24 16:43:01 root Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -278,7 +278,7 @@ char sbbs_t::getkey(long mode) console&=~CON_R_ECHOX; } bputs(text[CallBackWhenYoureThere]); - logline(nulstr,"Inactive"); + logline(LOG_NOTICE,nulstr,"Inactive"); hangup(); return(0); } @@ -299,9 +299,9 @@ char sbbs_t::getkey(long mode) /****************************************************************************/ /* Outputs a string highlighting characters preceeded by a tilde */ /****************************************************************************/ -void sbbs_t::mnemonics(char *str) +void sbbs_t::mnemonics(const char *str) { - char *ctrl_a_codes; + const char *ctrl_a_codes; long l; if(!strchr(str,'~')) { @@ -334,10 +334,11 @@ void sbbs_t::mnemonics(char *str) attr(cfg.color[clr_mnelow]); } else { - if(str[l]==CTRL_A /* ctrl-a */ - && str[l+1]!=0) { /* valid */ - ctrl_a(str[++l]); /* skip the ctrl-a */ - l++; /* skip the attribute code */ + if(str[l]==CTRL_A && str[l+1]!=0) { + l++; + if(toupper(str[l])=='Z') /* EOF */ + break; + ctrl_a(str[l++]); } else outchar(str[l++]); } @@ -351,18 +352,13 @@ void sbbs_t::mnemonics(char *str) /* Returns 1 for Y or 0 for N */ /* Called from quite a few places */ /****************************************************************************/ -bool sbbs_t::yesno(char *str) +bool sbbs_t::yesno(const char *str) { char ch; - strcpy(question,str); + SAFECOPY(question,str); SYNC; - if(useron.misc&WIP) { - strip_ctrl(question); - menu("yesno"); - } - else - bprintf(text[YesNoQuestion],str); + bprintf(text[YesNoQuestion],str); while(online) { if(sys_status&SS_ABORT) ch=text[YN][1]; @@ -389,18 +385,13 @@ bool sbbs_t::yesno(char *str) /* Returns 1 for N or 0 for Y */ /* Called from quite a few places */ /****************************************************************************/ -bool sbbs_t::noyes(char *str) +bool sbbs_t::noyes(const char *str) { char ch; - strcpy(question,str); + SAFECOPY(question,str); SYNC; - if(useron.misc&WIP) { - strip_ctrl(question); - menu("noyes"); - } - else - bprintf(text[NoYesQuestion],str); + bprintf(text[NoYesQuestion],str); while(online) { if(sys_status&SS_ABORT) ch=text[YN][1]; @@ -428,7 +419,7 @@ bool sbbs_t::noyes(char *str) /* it is echoed (upper case) and is the return value. */ /* Called from quite a few functions */ /****************************************************************************/ -long sbbs_t::getkeys(char *keys, ulong max) +long sbbs_t::getkeys(const char *keys, ulong max) { char str[81]; uchar ch,n=0,c=0; @@ -514,7 +505,7 @@ void sbbs_t::pause() rioctl(IOFI); bputs(text[Pause]); j=bstrlen(text[Pause]); - if(sys_status&SS_USERON && !(useron.misc&(WIP|NOPAUSESPIN)) + if(sys_status&SS_USERON && !(useron.misc&(HTML|WIP|NOPAUSESPIN)) && !(cfg.node_misc&NM_NOPAUSESPIN)) l|=K_SPIN; ch=getkey(l);