This commit is contained in:
Kovid Goyal
2016-11-23 11:11:23 +05:30
parent a0df10d0c2
commit 4b0e8fcb49
2 changed files with 7 additions and 7 deletions

View File

@@ -522,7 +522,7 @@ HANDLER(dcs) {
#endif
#define DISPATCH_DCS \
SET_STATE(NORMAL_STATE); \
if (!screen->parser_buf_pos) { REPORT_ERROR("Empty DCS sequence, ignoring."); return; } \
if (screen->parser_buf_pos == 0) { REPORT_ERROR("Empty DCS sequence, ignoring."); return; } \
REPORT_DCS; \
handle_dcs(screen, dump_callback);

View File

@@ -140,7 +140,7 @@ class TestScreen(BaseTest):
pb = partial(self.parse_bytes_dump, s)
c = Callbacks()
s.callbacks = c
pb(b'a\033]2;xyz\x9cbcde', 'a', ('set_title', 3), 'bcde')
pb(b'a\033]2;xyz\x07bcde', 'a', ('set_title', 3), 'bcde')
self.ae(str(s.line(0)), 'abcde')
self.ae(c.titlebuf, b'xyz')
c.clear()
@@ -154,8 +154,8 @@ class TestScreen(BaseTest):
pb('\033]110\x07', ('set_dynamic_color', 110, 0))
self.ae(c.colorbuf, b'')
def test_dcs_codes(self):
s = self.create_screen()
pb = partial(self.parse_bytes_dump, s)
pb(b'a\033P2;xyz\x9cbcde', 'a', 'bcde')
self.ae(str(s.line(0)), 'abcde')
# def test_dcs_codes(self):
# s = self.create_screen()
# pb = partial(self.parse_bytes_dump, s)
# pb(b'a\033P2;xyz\x9cbcde', 'a', 'bcde')
# self.ae(str(s.line(0)), 'abcde')