]> git.cameronkatri.com Git - mandoc.git/blobdiff - term.c
Fix spacing for tables to use term_len(). Also make term.c properly
[mandoc.git] / term.c
diff --git a/term.c b/term.c
index d402968ef56550799e3aefae1f9cdea47a9db823..ba54c31d2a794877db1167511d0590fcf41db48b 100644 (file)
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/*     $Id: term.c,v 1.175 2010/12/06 13:25:25 kristaps Exp $ */
+/*     $Id: term.c,v 1.176 2011/01/04 13:14:26 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -677,6 +677,12 @@ term_strlen(const struct termp *p, const char *cp)
                        if (rhs)
                                for (i = 0; i < rsz; i++)
                                        sz += (*p->width)(p, *rhs++);
+               } else if (ASCII_NBRSP == *cp) {
+                       sz += (*p->width)(p, ' ');
+                       cp++;
+               } else if (ASCII_HYPH == *cp) {
+                       sz += (*p->width)(p, '-');
+                       cp++;
                } else
                        sz += (*p->width)(p, *cp++);