summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2011-01-28 20:39:23 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2011-01-28 20:39:23 +0000
commitaee3e2bf5763658c0df3ab7a6c16de7331a197f9 (patch)
treeb3ccb74e2ce2eb4e1b401befc3682205b6a568fe /usr.bin
parentd15c6f407fde6dd1c1d7cf137d864cd8caa88550 (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 'usr.bin')
-rw-r--r--usr.bin/tmux/input.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c
index 8b839638f34..96fe062d7ec 100644
--- a/usr.bin/tmux/input.c
+++ b/usr.bin/tmux/input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input.c,v 1.34 2011/01/15 00:16:00 nicm Exp $ */
+/* $OpenBSD: input.c,v 1.35 2011/01/28 20:39:22 nicm 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. */