From 7774937656ef6397ed4ab101b3126cb3dae9a8ca Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 11 Sep 2010 20:28:03 +0000 Subject: [PATCH] more vt100 states git-svn-id: svn://qnap.local/TwoTerm/trunk@1761 5590a31f-7b70-45f8-8c82-aa3a8e5f4507 --- VT100.mm | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/VT100.mm b/VT100.mm index 7fb22d1..a344841 100644 --- a/VT100.mm +++ b/VT100.mm @@ -24,7 +24,9 @@ enum { StateDCAX, StateBracket, StateBracketQuestion, - StatePound + StatePound, + StateRParen, + StateLParen }; @@ -654,6 +656,14 @@ enum { return; } + if (_state == StateRParen || _state == StateLParen) + { + NSLog(@"[%s %s]: unrecognized escape character: `ESC %c %c' (%02x)", object_getClassName(self), sel_getName(_cmd), _state == StateRParen ? ')' : '(', c, (int)c); + + _state = StateText; + return; + } + if (_state == StateEsc) { switch(c) @@ -661,6 +671,19 @@ enum { case 0x00: case 0x07f: break; + + + case '(': + _state = StateLParen; + _parms.clear(); + _parms.push_back(0); + break; + + case ')': + _state = StateLParen; + _parms.clear(); + _parms.push_back(0); + break; case '[': _state = StateBracket;