diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-05-15 15:47:46 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-05-15 15:47:46 +0000 |
commit | de205044ce0e8b0414ab85bbd5e600391fe34e98 (patch) | |
tree | c8ac103de72d9177c7408747b5fee48d708a206a /term.c | |
parent | 877bef0b9533150581c911aff80cfbb71c13de8e (diff) | |
download | mandoc-de205044ce0e8b0414ab85bbd5e600391fe34e98.tar.gz |
Fix missing support for \N'n' when calculating string widths in -Tascii
(oops). Do the same for -Thtml (oops^2).
Diffstat (limited to 'term.c')
-rw-r--r-- | term.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -605,7 +605,7 @@ size_t term_strlen(const struct termp *p, const char *cp) { size_t sz, rsz, i; - int ssz; + int ssz, c; const char *seq, *rhs; static const char rej[] = { '\\', ASCII_HYPH, ASCII_NBRSP, '\0' }; @@ -624,9 +624,15 @@ term_strlen(const struct termp *p, const char *cp) switch (*cp) { case ('\\'): cp++; + rhs = NULL; switch (mandoc_escape(&cp, &seq, &ssz)) { case (ESCAPE_ERROR): return(sz); + case (ESCAPE_NUMBERED): + c = mchars_num2char(seq, ssz); + if ('\0' != c) + sz += (*p->width)(p, c); + break; case (ESCAPE_PREDEF): rhs = mchars_res2str (p->symtab, seq, ssz, &rsz); @@ -642,7 +648,6 @@ term_strlen(const struct termp *p, const char *cp) rsz = ssz; break; default: - rhs = NULL; break; } |