From 65f7f3515cf1a3af93d2dc8d724007d3b6ab1624 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Sat, 22 Jan 2011 17:08:25 -0500 Subject: [PATCH] Fix bug in state diagram --- parserstate.cpp | 2 +- terminal.cpp | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/parserstate.cpp b/parserstate.cpp index 37ea192..ea6be4c 100644 --- a/parserstate.cpp +++ b/parserstate.cpp @@ -149,7 +149,7 @@ Transition CSI_Entry::input_state_rule( wchar_t ch ) return Transition( new Param, &family->s_CSI_Param ); } - if ( (ch <= 0x3C) && (ch <= 0x3F) ) { + if ( (0x3C <= ch) && (ch <= 0x3F) ) { return Transition( new Collect, &family->s_CSI_Param ); } diff --git a/terminal.cpp b/terminal.cpp index 2e62c9a..57bcc09 100644 --- a/terminal.cpp +++ b/terminal.cpp @@ -67,18 +67,15 @@ std::string Emulator::input( char c, int actfd ) if ( (actfd > 0) && ( !act->handled ) ) { char actsum[ 32 ]; + wchar_t ch = L'\0'; if ( act->char_present ) { - if ( isprint( act->ch ) ) { - snprintf( actsum, 32, "%s(0x%02x=%lc) ", - act->name().c_str(), act->ch, act->ch ); - } else { - snprintf( actsum, 32, "%s(0x%02x) ", - act->name().c_str(), act->ch ); - } - } else { - snprintf( actsum, 32, "[%s] ", - act->name().c_str() ); + ch = act->ch; } + snprintf( actsum, 32, "%s[%s](%s){%lc} ", + act->name().c_str(), + dispatch_chars.c_str(), + params.c_str(), + ch ); swrite( actfd, actsum ); }