summaryrefslogtreecommitdiffstats
path: root/input.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2011-02-15 15:21:14 +0000
committerTiago Cunha <tcunha@gmx.com>2011-02-15 15:21:14 +0000
commit04ce5cc2d16fe6cd9df4944b812f1f0f48e21c1d (patch)
treed3061712e1494c1acba3b74d5a255f516ddae8a2 /input.c
parent065384056bab861e8fee6537ecaf7e7b5b3a15bd (diff)
Sync OpenBSD patchset 857:
Use input_clear to reset the APC, DCS, OSC state or it could be reused improperly by a later state. From Kevin Goodsell.
Diffstat (limited to 'input.c')
-rw-r--r--input.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/input.c b/input.c
index 7495a038..7ea1e963 100644
--- a/input.c
+++ b/input.c
@@ -1,4 +1,4 @@
-/* $Id: input.c,v 1.114 2011-01-21 23:56:11 tcunha Exp $ */
+/* $Id: input.c,v 1.115 2011-02-15 15:21:14 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -812,6 +812,9 @@ input_clear(struct input_ctx *ictx)
*ictx->param_buf = '\0';
ictx->param_len = 0;
+ *ictx->input_buf = '\0';
+ ictx->input_len = 0;
+
ictx->flags &= ~INPUT_DISCARD;
}
@@ -1394,7 +1397,7 @@ input_enter_dcs(struct input_ctx *ictx)
{
log_debug("%s", __func__);
- ictx->input_len = 0;
+ input_clear(ictx);
}
/* DCS terminator (ST) received. */
@@ -1410,7 +1413,7 @@ input_enter_osc(struct input_ctx *ictx)
{
log_debug("%s", __func__);
- ictx->input_len = 0;
+ input_clear(ictx);
}
/* OSC terminator (ST) received. */
@@ -1436,7 +1439,7 @@ input_enter_apc(struct input_ctx *ictx)
{
log_debug("%s", __func__);
- ictx->input_len = 0;
+ input_clear(ictx);
}
/* APC terminator (ST) received. */
@@ -1457,7 +1460,7 @@ input_enter_rename(struct input_ctx *ictx)
{
log_debug("%s", __func__);
- ictx->input_len = 0;
+ input_clear(ictx);
}
/* Rename terminator (ST) received. */