- p->offset += term_len(p, (p->defindent + 1) * 2);
- else
- p->offset += a2width(p, n->norm->Bd.offs);
-
- /*
- * If -ragged or -filled are specified, the block does nothing
- * but change the indentation. If -unfilled or -literal are
- * specified, text is printed exactly as entered in the display:
- * for macro lines, a newline is appended to the line. Blank
- * lines are allowed.
- */
-
- if (DISP_literal != n->norm->Bd.type &&
- DISP_unfilled != n->norm->Bd.type &&
- DISP_centered != n->norm->Bd.type)
- return(1);
-
- tabwidth = p->tabwidth;
- if (DISP_literal == n->norm->Bd.type)
- p->tabwidth = term_len(p, 8);
-
- lm = p->offset;
- rm = p->rmargin;
- rmax = p->maxrmargin;
- p->rmargin = p->maxrmargin = TERM_MAXMARGIN;
-
- for (nn = n->child; nn; nn = nn->next) {
- if (DISP_centered == n->norm->Bd.type) {
- if (MDOC_TEXT == nn->type) {
- len = term_strlen(p, nn->string);
- p->offset = len >= rm ? 0 :
- lm + len >= rm ? rm - len :
- (lm + rm - len) / 2;
- } else
- p->offset = lm;
- }
- print_mdoc_node(p, pair, meta, nn);
- /*
- * If the printed node flushes its own line, then we
- * needn't do it here as well. This is hacky, but the
- * notion of selective eoln whitespace is pretty dumb
- * anyway, so don't sweat it.
- */
- switch (nn->tok) {
- case MDOC_Sm:
- /* FALLTHROUGH */
- case MDOC_br:
- /* FALLTHROUGH */
- case MDOC_sp:
- /* FALLTHROUGH */
- case MDOC_Bl:
- /* FALLTHROUGH */
- case MDOC_D1:
- /* FALLTHROUGH */
- case MDOC_Dl:
- /* FALLTHROUGH */
- case MDOC_Lp:
- /* FALLTHROUGH */
- case MDOC_Pp:
- continue;
- default:
- break;
- }
- if (nn->next && nn->next->line == nn->line)
- continue;
- term_flushln(p);
- p->flags |= TERMP_NOSPACE;
+ p->tcol->offset += term_len(p, (p->defindent + 1) * 2);
+ else {
+ offset = a2width(p, n->norm->Bd.offs);
+ if (offset < 0 && (size_t)(-offset) > p->tcol->offset)
+ p->tcol->offset = 0;
+ else if (offset < SHRT_MAX)
+ p->tcol->offset += offset;