summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-12-23 08:15:37 +0000
committerschwarze <schwarze@openbsd.org>2014-12-23 08:15:37 +0000
commitb3e83c55639f29451f787dc548f2bccf54866a8d (patch)
treef7954a21034ea1f2c10e6947aab9829f848c06f6
parentto be safe, revert locking change until further tested. (diff)
downloadwireguard-openbsd-b3e83c55639f29451f787dc548f2bccf54866a8d.tar.xz
wireguard-openbsd-b3e83c55639f29451f787dc548f2bccf54866a8d.zip
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;