summaryrefslogtreecommitdiffstats
path: root/input.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-01-28 20:39:22 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-01-28 20:39:22 +0000
commitb6bb350289f9eec1c6486ef356033e6f2b542ad0 (patch)
tree1596c89a55c199271537a30d8940ce53aeec59b1 /input.c
parentbcc7c689c163173086882fdd1f069b0da9bb53f6 (diff)
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.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/input.c b/input.c
index df387dad..73e02099 100644
--- a/input.c
+++ b/input.c
@@ -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. */