diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-03 08:11:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-03 08:11:24 +0000 |
commit | 111f4a8fe5cb6a9197fa79a693629757b31ab30d (patch) | |
tree | 8595b6e5a893504eaf417b018c664001c814ca1e /win32 | |
parent | adf1c94ffe75cea7d6b12ac10809656c15d33079 (diff) | |
download | ruby-111f4a8fe5cb6a9197fa79a693629757b31ab30d.tar.gz |
win32.c: pass through unknown sequence
* win32/win32.c (constat_apply): pass through unknown sequence which
starts with ESC but is not followed by a bracket. [ruby-core:53879]
[Bug #8201]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c index 3ce6949779..cdac41b456 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -5787,9 +5787,19 @@ constat_parse(HANDLE h, struct constat *s, const WCHAR **ptrp, long *lenp) WCHAR wc = *ptr++; if (wc == 0x1b) { rest = *lenp - len - 1; + if (s->vt100.state == constat_esc) { + rest++; /* reuse this ESC */ + } + s->vt100.state = constat_init; + if (len > 0 && *ptr != L'[') continue; s->vt100.state = constat_esc; } - else if (s->vt100.state == constat_esc && wc == L'[') { + else if (s->vt100.state == constat_esc) { + if (wc != L'[') { + /* TODO: supply dropped ESC at beginning */ + s->vt100.state = constat_init; + continue; + } rest = *lenp - len - 1; if (rest > 0) --rest; s->vt100.state = constat_seq; |