[前][次][番号順一覧][スレッド一覧]

ruby-changes:28026

From: nobu <ko1@a...>
Date: Wed, 3 Apr 2013 17:11:35 +0900 (JST)
Subject: [ruby-changes:28026] nobu:r40078 (trunk): win32.c: pass through unknown sequence

nobu	2013-04-03 17:11:24 +0900 (Wed, 03 Apr 2013)

  New Revision: 40078

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40078

  Log:
    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]

  Modified files:
    trunk/win32/win32.c

Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 40077)
+++ win32/win32.c	(revision 40078)
@@ -5787,9 +5787,19 @@ constat_parse(HANDLE h, struct constat * https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L5787
 	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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]