summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'term.c')
-rw-r--r--term.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/term.c b/term.c
index 65ca6ffa..28a26951 100644
--- a/term.c
+++ b/term.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010-2016 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -606,8 +606,20 @@ encode(struct termp *p, const char *word, size_t sz)
if (ASCII_HYPH == word[i] ||
isgraph((unsigned char)word[i]))
encode1(p, word[i]);
- else
+ else {
p->buf[p->col++] = word[i];
+
+ /*
+ * Postpone the effect of \z while handling
+ * an overstrike sequence from ascii_uc2str().
+ */
+
+ if (word[i] == '\b' &&
+ (p->flags & TERMP_BACKBEFORE)) {
+ p->flags &= ~TERMP_BACKBEFORE;
+ p->flags |= TERMP_BACKAFTER;
+ }
+ }
}
}