even if the second argument to .IP is invalid, don't print it
authorschwarze <schwarze@openbsd.org>
Tue, 23 Dec 2014 08:15:37 +0000 (08:15 +0000)
committerschwarze <schwarze@openbsd.org>
Tue, 23 Dec 2014 08:15:37 +0000 (08:15 +0000)
regress/usr.bin/mandoc/man/IP/width.in
regress/usr.bin/mandoc/man/IP/width.out_ascii
usr.bin/mandoc/man_term.c

index 2663242..8c30b93 100644 (file)
@@ -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
index 65c60c4..83a6e32 100644 (file)
@@ -26,6 +26,9 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
        tag  indented
             text
 
+       tag  indented
+            text
+
        tag                                                                                                 indented
                                                                                                            text
 
@@ -49,9 +52,12 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
        tag  indented
             text
 
+       tag  indented
+            text
+
        tag                                                                                                 indented
                                                                                                            text
 
 
 
-OpenBSD                        February 16, 2014                   IP-WIDTH(1)
+OpenBSD                        December 23, 2014                   IP-WIDTH(1)
index a27a287..61db99d 100644 (file)
@@ -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;