aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-12-23 09:31:46 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-12-23 09:31:46 +0000
commitb746353a05b8aa9d139a3058dfc846eb7c978997 (patch)
tree148663f150cd664bbc197e0cecd0dbb1c442a185 /man_term.c
parent5d42210e3b9f8220e4026cbeb581e5953e7bd23d (diff)
downloadmandoc-b746353a05b8aa9d139a3058dfc846eb7c978997.tar.gz
mandoc-b746353a05b8aa9d139a3058dfc846eb7c978997.tar.zst
mandoc-b746353a05b8aa9d139a3058dfc846eb7c978997.zip
some scaling unit fixes:
- .sp with an invalid argument is .sp 1v, not .sp 0v - in man(1), trailing garbage doesn't make scaling units invalid
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/man_term.c b/man_term.c
index 5c09199a..9433ddd8 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.161 2014/12/23 08:15:53 schwarze Exp $ */
+/* $Id: man_term.c,v 1.162 2014/12/23 09:31:46 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -57,7 +57,6 @@ struct termact {
};
static int a2width(const struct termp *, const char *);
-static size_t a2height(const struct termp *, const char *);
static void print_man_nodelist(DECL_ARGS);
static void print_man_node(DECL_ARGS);
@@ -184,18 +183,6 @@ terminal_man(void *arg, const struct man *man)
}
}
-
-static size_t
-a2height(const struct termp *p, const char *cp)
-{
- struct roffsu su;
-
- if ( ! a2roffsu(cp, &su, SCALE_VS))
- SCALE_VS_INIT(&su, atoi(cp));
-
- return(term_vspan(p, &su));
-}
-
static int
a2width(const struct termp *p, const char *cp)
{
@@ -464,6 +451,7 @@ pre_in(DECL_ARGS)
static int
pre_sp(DECL_ARGS)
{
+ struct roffsu su;
char *s;
size_t i, len;
int neg;
@@ -501,7 +489,9 @@ pre_sp(DECL_ARGS)
neg = 1;
s++;
}
- len = a2height(p, s);
+ if ( ! a2roffsu(s, &su, SCALE_VS))
+ su.scale = 1.0;
+ len = term_vspan(p, &su);
break;
}