=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/term.c,v retrieving revision 1.120 retrieving revision 1.121 diff -u -r1.120 -r1.121 --- src/usr.bin/mandoc/term.c 2017/05/07 17:30:58 1.120 +++ src/usr.bin/mandoc/term.c 2017/06/01 19:05:15 1.121 @@ -1,4 +1,4 @@ -/* $OpenBSD: term.c,v 1.120 2017/05/07 17:30:58 schwarze Exp $ */ +/* $OpenBSD: term.c,v 1.121 2017/06/01 19:05:15 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze @@ -398,6 +398,7 @@ void term_word(struct termp *p, const char *word) { + struct roffsu su; const char nbrsp[2] = { ASCII_NBRSP, 0 }; const char *seq, *cp; int sz, uc; @@ -485,6 +486,27 @@ p->flags &= ~TERMP_BACKAFTER; else if (*word == '\0') p->flags |= (TERMP_NOSPACE | TERMP_NONEWLINE); + continue; + case ESCAPE_HORIZ: + if (a2roffsu(seq, &su, SCALE_EM) == 0) + continue; + uc = term_hspan(p, &su) / 24; + if (uc > 0) + while (uc-- > 0) + bufferc(p, ASCII_NBRSP); + else if (p->col > (size_t)(-uc)) + p->col += uc; + else { + uc += p->col; + p->col = 0; + if (p->offset > (size_t)(-uc)) { + p->ti += uc; + p->offset += uc; + } else { + p->ti -= p->offset; + p->offset = 0; + } + } continue; case ESCAPE_SKIPCHAR: p->flags |= TERMP_BACKAFTER;