From e6d1719915ce2f572e471fea82358f606b7fd586 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 15 Sep 2010 14:36:16 +0000 Subject: Allow string lengths to account for escapes. Now all calls to calculate column width in -Tascii, -Tpdf, and -Tps will account for "more real" string lengths. Example: .Bl -tag -width \s[+123424]foo .It bar baz .El The size escape will be correctly tossed. .Bl -tag -width \(aqbar .It \(aqbar baz .El The \(aq will be correctly handled. --- man_term.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'man_term.c') diff --git a/man_term.c b/man_term.c index c7cbea88..f9a02fda 100644 --- a/man_term.c +++ b/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.84 2010/07/23 13:22:35 kristaps Exp $ */ +/* $Id: man_term.c,v 1.85 2010/09/15 14:36:16 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -916,6 +916,10 @@ print_man_foot(struct termp *p, const void *arg) p->rmargin = p->maxrmargin - term_strlen(p, buf); p->offset = 0; + /* term_strlen() can return zero. */ + if (p->rmargin == p->maxrmargin) + p->rmargin--; + if (meta->source) term_word(p, meta->source); if (meta->source) -- cgit v1.2.3