mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-01 12:00:35 +08:00
Cygwin: pty: Fix a bug in the code removing set window title sequence.
- Commit 4e08fe42c9f3fdba63a57a8e3a6d705c4e10f50f has a bug which may cause infinite loop in pty_master_fwd_thread(). This patch fixes the issue.
This commit is contained in:
parent
4e08fe42c9
commit
6871c8418d
@ -2168,17 +2168,14 @@ fhandler_pty_master::pty_master_fwd_thread ()
|
||||
/* Remove Set title sequence */
|
||||
char *p0, *p1;
|
||||
p0 = outbuf;
|
||||
while ((p0 = (char *) memmem (p0, rlen, "\033]0;", 4)))
|
||||
{
|
||||
p1 = (char *) memchr (p0, '\007', rlen - (p0 - outbuf));
|
||||
if (p1)
|
||||
while ((p0 = (char *) memmem (p0, rlen, "\033]0;", 4))
|
||||
&& (p1 = (char *) memchr (p0, '\007', rlen-(p0-outbuf))))
|
||||
{
|
||||
memmove (p0, p1 + 1, rlen - (p1 + 1 - outbuf));
|
||||
rlen -= p1 + 1 - p0;
|
||||
wlen = rlen;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Remove CSI > Pm m */
|
||||
int state = 0;
|
||||
int start_at = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user