aboutsummaryrefslogtreecommitdiff
path: root/driver-ti.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-18 14:03:39 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-18 14:03:39 +0000
commit6d6afe788c3ec1f320e12449eee230fb366228c5 (patch)
treea7f17b111e20dbe67bcaf5067f2ecd9c00d9f1db /driver-ti.c
parent82ad14175cbcc7c0c660720c7a31f8e6f1cefe4e (diff)
downloadtermo-6d6afe788c3ec1f320e12449eee230fb366228c5.tar.gz
termo-6d6afe788c3ec1f320e12449eee230fb366228c5.tar.xz
termo-6d6afe788c3ec1f320e12449eee230fb366228c5.zip
Allow passing fd = -1 to constructor to make an instance not associated with an fd; must use push_bytes to provide it input
Diffstat (limited to 'driver-ti.c')
-rw-r--r--driver-ti.c4
1 files changed, 2 insertions, 2 deletions
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));
}