From 6d6afe788c3ec1f320e12449eee230fb366228c5 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Wed, 18 Jan 2012 14:03:39 +0000 Subject: Allow passing fd = -1 to constructor to make an instance not associated with an fd; must use push_bytes to provide it input --- driver-ti.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'driver-ti.c') diff --git a/driver-ti.c b/driver-ti.c index 49e8c6d..e8515e3 100644 --- a/driver-ti.c +++ b/driver-ti.c @@ -296,7 +296,7 @@ static void start_driver(TermKey *tk, void *info) /* The terminfo database will contain keys in application cursor key mode. * We may need to enable that mode */ - if(ti->start_string) { + if(tk->fd != -1 && ti->start_string) { // Can't call putp or tputs because they suck and don't give us fd control write(tk->fd, ti->start_string, strlen(ti->start_string)); } @@ -306,7 +306,7 @@ static void stop_driver(TermKey *tk, void *info) { TermKeyTI *ti = info; - if(ti->stop_string) { + if(tk->fd != -1 && ti->stop_string) { // Can't call putp or tputs because they suck and don't give us fd control write(tk->fd, ti->stop_string, strlen(ti->stop_string)); } -- cgit v1.2.3