From: schwarze Date: Tue, 23 Dec 2014 08:15:37 +0000 (+0000) Subject: even if the second argument to .IP is invalid, don't print it X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b3e83c55639f29451f787dc548f2bccf54866a8d;p=openbsd even if the second argument to .IP is invalid, don't print it --- 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 * Copyright (c) 2010-2014 Ingo Schwarze @@ -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;