Subject: xsrc/29003: Bug in xterm
To: None <xsrc-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <bqt@update.uu.se>
List: netbsd-bugs
Date: 01/18/2005 22:27:00
>Number:         29003
>Category:       xsrc
>Synopsis:       xterm get's confused by ST sequence
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 18 22:27:00 +0000 2005
>Originator:     Johnny Billquist
>Release:        NetBSD 2.99.12
>Organization:
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt@update.uu.se           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol
>Environment:
System: NetBSD Junk.BQTnet.SE 2.99.12 NetBSD 2.99.12 (Junk) #0: Tue Jan 4 18:43:18 CET 2005 root@Junk.BQTnet.SE:/usr/obj/sys/arch/i386/compile/Junk i386
Architecture: i386
Machine: i386
>Description:
The ST sequence is used to terminate some of the more complex escape
sequences. If an ST is received while not parsing a sequence, xterm
gobbles up a few characters of the input stream.
The reason is that a state variable isn't reset from parsing the
escape sequence if the sequence is ST, and we're not currently
inside that more complex sequence.
>How-To-Repeat:
Just send the ST sequence, and watch the next character disappear.
>Fix:
Index: charproc.c
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/xterm/charproc.c,v
retrieving revision 1.5
diff -c -r1.5 charproc.c
*** charproc.c	5 Mar 2004 16:33:12 -0000	1.5
--- charproc.c	18 Jan 2005 22:21:51 -0000
***************
*** 2164,2169 ****
--- 2164,2170 ----
  	    break;
  
  	case CASE_ST:
+ 	    parsestate = groundtable;
  	    if (!string_used)
  		break;
  	    string_area[--string_used] = '\0';
***************
*** 2184,2190 ****
  		/* ignored */
  		break;
  	    }
- 	    parsestate = groundtable;
  	    break;
  
  	case CASE_SOS:
--- 2185,2190 ----