termcap "me" does not reset the alternate character set

This commit is contained in:
Markus Gans 2017-03-30 00:46:52 +02:00
parent d5b2c9dc99
commit bcfa7fb731
3 changed files with 30 additions and 18 deletions

View File

@ -1,3 +1,7 @@
2017-03-30 Markus Gans <guru.mail@muenster.de>
* Fixed bug: termcap "me" does not reset
the alternate character set
2017-03-28 Markus Gans <guru.mail@muenster.de> 2017-03-28 Markus Gans <guru.mail@muenster.de>
* Improved graphic charset pairs (vt100) * Improved graphic charset pairs (vt100)
for FreeBSD console for FreeBSD console

View File

@ -529,18 +529,26 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next)
if ( hasNoAttribute(next) ) if ( hasNoAttribute(next) )
{ {
if ( off.pc_charset )
unsetTermPCcharset(term);
if ( off.alt_charset )
unsetTermAltCharset(term);
if ( hasAttribute(term) ) if ( hasAttribute(term) )
{ {
if ( F_exit_attribute_mode.cap ) if ( F_exit_attribute_mode.cap )
{
unsetTermAttributes(term); unsetTermAttributes(term);
if ( off.pc_charset )
unsetTermPCcharset(term);
if ( off.alt_charset )
unsetTermAltCharset(term);
}
else else
{ {
if ( off.pc_charset )
unsetTermPCcharset(term);
if ( off.alt_charset )
unsetTermAltCharset(term);
if ( off.bold ) if ( off.bold )
unsetTermBold(term); unsetTermBold(term);
@ -579,11 +587,8 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next)
if ( colorChange(term, next) ) if ( colorChange(term, next) )
change_color (term, next); change_color (term, next);
} }
else if ( F_set_attributes.cap ) else if ( F_set_attributes.cap && ! term->pc_charset )
{ {
if ( off.pc_charset )
unsetTermPCcharset(term);
if ( switchOn() || switchOff() ) if ( switchOn() || switchOff() )
setTermAttributes ( term setTermAttributes ( term
, next->standout , next->standout
@ -596,6 +601,9 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next)
, next->protect , next->protect
, next->alt_charset ); , next->alt_charset );
if ( off.pc_charset )
unsetTermPCcharset(term);
if ( next->italic ) if ( next->italic )
setTermItalic(term); setTermItalic(term);
@ -676,12 +684,12 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next)
detectSwitchOn (term, next); detectSwitchOn (term, next);
if ( on.pc_charset )
setTermPCcharset(term);
if ( on.alt_charset ) if ( on.alt_charset )
setTermAltCharset(term); setTermAltCharset(term);
if ( on.pc_charset )
setTermPCcharset(term);
if ( on.bold ) if ( on.bold )
setTermBold(term); setTermBold(term);

View File

@ -2545,17 +2545,17 @@ inline void FVTerm::charsetChanges (char_data*& next_char)
return; return;
uInt code = uInt(next_char->code); uInt code = uInt(next_char->code);
uInt ch = charEncode(code); uInt ch_enc = charEncode(code);
if ( ch != code ) if ( ch_enc != code )
{ {
if ( ch == 0 ) if ( ch_enc == 0 )
{ {
next_char->code = int(charEncode(code, fc::ASCII)); next_char->code = int(charEncode(code, fc::ASCII));
return; return;
} }
next_char->code = int(ch); next_char->code = int(ch_enc);
if ( Encoding == fc::VT100 ) if ( Encoding == fc::VT100 )
next_char->alt_charset = true; next_char->alt_charset = true;
@ -2563,7 +2563,7 @@ inline void FVTerm::charsetChanges (char_data*& next_char)
{ {
next_char->pc_charset = true; next_char->pc_charset = true;
if ( isXTerminal() && hasUTF8() && ch < 0x20 ) // Character 0x00..0x1f if ( isXTerminal() && hasUTF8() && ch_enc < 0x20 ) // Character 0x00..0x1f
next_char->code = int(charEncode(code, fc::ASCII)); next_char->code = int(charEncode(code, fc::ASCII));
} }
} }