summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-06-27 12:43:12 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-06-27 12:43:12 +0000
commit4bfe8c2e9800ab93c0ba8ebb67e327642f6df9f7 (patch)
treea8eb3de3bac2bd8d244d5637d07f39f8a6518d09
parentb4fddaa8b1c8d268977963111976898b660e90f1 (diff)
sync to 1.7.20: (1) -width Ds is 6 spaces, not 8, see the manual.
(2) When determining the offset, add two more spaces to the width. For -width Ds, these two bugs cancelled each other, but for -width [01-9]+n, they did not, leaving the offset to narrow. (3) When determining the width using strlen, we need to add two spaces instead of one, just like in the case (2).
-rw-r--r--usr.bin/mandoc/mdoc_action.c6
-rw-r--r--usr.bin/mandoc/mdoc_term.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/mandoc/mdoc_action.c b/usr.bin/mandoc/mdoc_action.c
index 0dfe3f53303..07bf691135d 100644
--- a/usr.bin/mandoc/mdoc_action.c
+++ b/usr.bin/mandoc/mdoc_action.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_action.c,v 1.8 2009/06/23 23:02:54 schwarze Exp $ */
+/* $Id: mdoc_action.c,v 1.9 2009/06/27 12:43:11 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -89,7 +89,7 @@ const struct actions mdoc_actions[MDOC_MAX] = {
{ NULL, NULL }, /* Ad */
{ NULL, NULL }, /* An */
{ NULL, post_ar }, /* Ar */
- { NULL, NULL }, /* Cd */
+ { NULL, NULL }, /* Cd */ /* FIXME: tabs are accepted! */
{ NULL, NULL }, /* Cm */
{ NULL, NULL }, /* Dv */
{ NULL, NULL }, /* Er */
@@ -609,7 +609,7 @@ post_bl_width(struct mdoc *m)
*/
if (0 == strcmp(p, "Ds"))
- width = 8;
+ width = 6;
else if (MDOC_MAX == (tok = mdoc_hash_find(m->htab, p)))
return(1);
else if (0 == (width = mdoc_macro2len(tok)))
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index 2a63b19d513..26af4b78eeb 100644
--- a/usr.bin/mandoc/mdoc_term.c
+++ b/usr.bin/mandoc/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.17 2009/06/27 12:04:45 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.18 2009/06/27 12:43:11 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -543,11 +543,11 @@ arg_width(const struct mdoc_argv *arg, int pos)
if ('n' == arg->value[pos][len - 1] ||
'm' == arg->value[pos][len - 1]) {
v = (size_t)atoi(arg->value[pos]);
- return(v);
+ return(v + 2);
}
}
- return(strlen(arg->value[pos]) + 1);
+ return(strlen(arg->value[pos]) + 2);
}