diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-09-15 14:36:16 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-09-15 14:36:16 +0000 |
commit | e6d1719915ce2f572e471fea82358f606b7fd586 (patch) | |
tree | 4976a030c79c59d0aae95f593d34fd1480226fa6 /man_term.c | |
parent | 9092c5d03b04ccca832c2642ae0a453409c7c0a9 (diff) | |
download | mandoc-e6d1719915ce2f572e471fea82358f606b7fd586.tar.gz mandoc-e6d1719915ce2f572e471fea82358f606b7fd586.tar.zst mandoc-e6d1719915ce2f572e471fea82358f606b7fd586.zip |
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.
Diffstat (limited to 'man_term.c')
-rw-r--r-- | man_term.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 <kristaps@bsd.lv> * @@ -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) |