summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-12-23 08:15:38 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-12-23 08:15:38 +0000
commitd16a0d9038e216a1d7b69623be8e78a11a40a416 (patch)
treee9730cdabf84737a45592608f43fa408ea8d1d3d
parented439ed4d2e756a9e996a49602a8d57815c5a0f4 (diff)
even if the second argument to .IP is invalid, don't print it
-rw-r--r--regress/usr.bin/mandoc/man/IP/width.in9
-rw-r--r--regress/usr.bin/mandoc/man/IP/width.out_ascii8
-rw-r--r--usr.bin/mandoc/man_term.c7
3 files changed, 18 insertions, 6 deletions
diff --git a/regress/usr.bin/mandoc/man/IP/width.in b/regress/usr.bin/mandoc/man/IP/width.in
index 266324244bc..8c30b93b15e 100644
--- a/regress/usr.bin/mandoc/man/IP/width.in
+++ b/regress/usr.bin/mandoc/man/IP/width.in
@@ -1,4 +1,4 @@
-.TH IP-WIDTH 1 "February 16, 2014" OpenBSD
+.TH IP-WIDTH 1 "December 23, 2014" OpenBSD
.SH NAME
IP-width \- indentation width of indented paragraphs
.SH DESCRIPTION
@@ -23,6 +23,10 @@ text
indented
.br
text
+.IP tag xxx
+indented
+.br
+text
.IP tag 100n
indented
.br
@@ -45,6 +49,9 @@ text
.IP tag 5n
indented
text
+.IP tag xxx
+indented
+text
.IP tag 100n
indented
text
diff --git a/regress/usr.bin/mandoc/man/IP/width.out_ascii b/regress/usr.bin/mandoc/man/IP/width.out_ascii
index 65c60c4d4c7..83a6e32229c 100644
--- a/regress/usr.bin/mandoc/man/IP/width.out_ascii
+++ b/regress/usr.bin/mandoc/man/IP/width.out_ascii
@@ -26,6 +26,9 @@ DDEESSCCRRIIPPTTIIOONN
tag indented
text
+ tag indented
+ text
+
tag indented
text
@@ -49,9 +52,12 @@ DDEESSCCRRIIPPTTIIOONN
tag indented
text
+ tag indented
+ text
+
tag indented
text
-OpenBSD February 16, 2014 IP-WIDTH(1)
+OpenBSD December 23, 2014 IP-WIDTH(1)
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index a27a287ae45..61db99d3906 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.113 2014/12/23 01:57:11 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.114 2014/12/23 08:15:37 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -631,11 +631,10 @@ pre_IP(DECL_ARGS)
p->offset = mt->offset;
p->rmargin = mt->offset + len;
- if (ival < 0)
- break;
/* Set the saved left-margin. */
- mt->lmargin[mt->lmargincur] = (size_t)ival;
+ if (ival >= 0)
+ mt->lmargin[mt->lmargincur] = (size_t)ival;
savelit = MANT_LITERAL & mt->fl;
mt->fl &= ~MANT_LITERAL;