summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-12-04 02:05:17 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-12-04 02:05:17 +0000
commit3609cf92194384b8a354c3f8004ddf8fa9a33511 (patch)
tree73b2006333b791f8a04be526a46a8e07a9b67567
parent7bb3334875fd974cb0873330c7725cb8ed21021a (diff)
fix handling of roff requests having a default scale other than "n",
in particular .sp which uses "v", when the scale is not specified; cures groff-mandoc differences in about a dozen Xenocara manuals
-rw-r--r--regress/usr.bin/mandoc/roff/sp/badargs-man.in6
-rw-r--r--regress/usr.bin/mandoc/roff/sp/badargs-man.out_ascii6
-rw-r--r--regress/usr.bin/mandoc/roff/sp/badargs-mdoc.in6
-rw-r--r--regress/usr.bin/mandoc/roff/sp/badargs-mdoc.out_ascii6
-rw-r--r--usr.bin/mandoc/man_html.c4
-rw-r--r--usr.bin/mandoc/man_term.c4
-rw-r--r--usr.bin/mandoc/out.c4
7 files changed, 22 insertions, 14 deletions
diff --git a/regress/usr.bin/mandoc/roff/sp/badargs-man.in b/regress/usr.bin/mandoc/roff/sp/badargs-man.in
index eca9367f2a8..46b9ab6512b 100644
--- a/regress/usr.bin/mandoc/roff/sp/badargs-man.in
+++ b/regress/usr.bin/mandoc/roff/sp/badargs-man.in
@@ -1,6 +1,6 @@
-.TH SP-BADARGS-MAN 1 "January 17, 2010" OpenBSD
+.TH SP-BADARGS-MAN 1 "December 4, 2014" OpenBSD
.SH NAME
-sp-badargs-man \- bad numbers of arguments to .sp macros in man(7)
+sp-badargs-man \- bad arguments to .sp macros in man(7)
.SH DESCRIPTION
no arguments:
.sp
@@ -8,4 +8,6 @@ one argument:
.sp 2v
two arguments:
.sp 3v 2i
+no scaling unit specified:
+.sp 1
end of test document
diff --git a/regress/usr.bin/mandoc/roff/sp/badargs-man.out_ascii b/regress/usr.bin/mandoc/roff/sp/badargs-man.out_ascii
index 8ecb8928aee..1c559570458 100644
--- a/regress/usr.bin/mandoc/roff/sp/badargs-man.out_ascii
+++ b/regress/usr.bin/mandoc/roff/sp/badargs-man.out_ascii
@@ -3,7 +3,7 @@ SP-BADARGS-MAN(1) General Commands Manual SP-BADARGS-MAN(1)
NNAAMMEE
- sp-badargs-man - bad numbers of arguments to .sp macros in man(7)
+ sp-badargs-man - bad arguments to .sp macros in man(7)
DDEESSCCRRIIPPTTIIOONN
no arguments:
@@ -15,8 +15,10 @@ DDEESSCCRRIIPPTTIIOONN
+ no scaling unit specified:
+
end of test document
-OpenBSD January 17, 2010 SP-BADARGS-MAN(1)
+OpenBSD December 4, 2014 SP-BADARGS-MAN(1)
diff --git a/regress/usr.bin/mandoc/roff/sp/badargs-mdoc.in b/regress/usr.bin/mandoc/roff/sp/badargs-mdoc.in
index 46c0b0af8f1..f7cf74a6578 100644
--- a/regress/usr.bin/mandoc/roff/sp/badargs-mdoc.in
+++ b/regress/usr.bin/mandoc/roff/sp/badargs-mdoc.in
@@ -1,9 +1,9 @@
-.Dd January 2, 2011
+.Dd December 4, 2014
.Dt SP-BADARGS-MDOC 1
.Os OpenBSD
.Sh NAME
.Nm sp-badargs-mdoc
-.Nd bad numbers of arguments to .sp macros in mdoc(7)
+.Nd bad arguments to .sp macros in mdoc(7)
.Sh DESCRIPTION
no arguments:
.sp
@@ -11,4 +11,6 @@ one argument:
.sp 2v
two arguments:
.sp 3v 2i
+no scaling unit specified:
+.sp 1
end of test document
diff --git a/regress/usr.bin/mandoc/roff/sp/badargs-mdoc.out_ascii b/regress/usr.bin/mandoc/roff/sp/badargs-mdoc.out_ascii
index 01b6e13617e..c9d03c2ed67 100644
--- a/regress/usr.bin/mandoc/roff/sp/badargs-mdoc.out_ascii
+++ b/regress/usr.bin/mandoc/roff/sp/badargs-mdoc.out_ascii
@@ -1,7 +1,7 @@
SP-BADARGS-MDOC(1) General Commands Manual SP-BADARGS-MDOC(1)
NNAAMMEE
- sspp--bbaaddaarrggss--mmddoocc - bad numbers of arguments to .sp macros in mdoc(7)
+ sspp--bbaaddaarrggss--mmddoocc - bad arguments to .sp macros in mdoc(7)
DDEESSCCRRIIPPTTIIOONN
no arguments:
@@ -13,6 +13,8 @@ DDEESSCCRRIIPPTTIIOONN
+ no scaling unit specified:
+
end of test document
-OpenBSD January 2, 2011 OpenBSD
+OpenBSD December 4, 2014 OpenBSD
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c
index cde34a999c3..facecf9b7af 100644
--- a/usr.bin/mandoc/man_html.c
+++ b/usr.bin/mandoc/man_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_html.c,v 1.59 2014/12/02 10:07:17 schwarze Exp $ */
+/* $OpenBSD: man_html.c,v 1.60 2014/12/04 02:05:16 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -280,7 +280,7 @@ a2width(const struct man_node *n, struct roffsu *su)
if (MAN_TEXT != n->type)
return(0);
- if (a2roffsu(n->string, su, SCALE_BU))
+ if (a2roffsu(n->string, su, SCALE_EN))
return(1);
return(0);
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 0852d2afbbc..b7ead70a122 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_term.c,v 1.111 2014/12/04 01:33:23 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.112 2014/12/04 02:05:16 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -199,7 +199,7 @@ a2width(const struct termp *p, const char *cp)
{
struct roffsu su;
- if ( ! a2roffsu(cp, &su, SCALE_BU))
+ if ( ! a2roffsu(cp, &su, SCALE_EN))
return(-1);
return((int)term_hspan(p, &su));
diff --git a/usr.bin/mandoc/out.c b/usr.bin/mandoc/out.c
index a05f29e732b..402ea1e9000 100644
--- a/usr.bin/mandoc/out.c
+++ b/usr.bin/mandoc/out.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: out.c,v 1.25 2014/10/14 18:16:57 schwarze Exp $ */
+/* $OpenBSD: out.c,v 1.26 2014/12/04 02:05:16 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -108,7 +108,7 @@ a2roffsu(const char *src, struct roffsu *dst, enum roffscale def)
case '\0':
if (SCALE_MAX == def)
return(0);
- unit = SCALE_EN;
+ unit = def;
break;
case 'u':
unit = SCALE_BU;