source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Make the `-width' field to `Bl' not puke if it doesn't have an
@ 2012-03-23  5:50 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2012-03-23  5:50 UTC (permalink / raw)
  To: source

Log Message:
-----------
Make the `-width' field to `Bl' not puke if it doesn't have an argument.
This makes mandoc work much, much nicer with Mac OSX manpages.

Modified Files:
--------------
    mdocml:
        mdoc_argv.c
        mdoc_validate.c

Revision Data
-------------
Index: mdoc_validate.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v
retrieving revision 1.181
retrieving revision 1.182
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.181 -r1.182
--- mdoc_validate.c
+++ mdoc_validate.c
@@ -661,8 +661,13 @@ pre_bl(PRE_ARGS)
 			comp = 1;
 			break;
 		case (MDOC_Width):
-			dup = (NULL != n->norm->Bl.width);
-			width = n->args->argv[i].value[0];
+			/* NB: this can be empty! */
+			if (n->args->argv[i].sz) {
+				width = n->args->argv[i].value[0];
+				dup = (NULL != n->norm->Bl.width);
+				break;
+			}
+			mdoc_nmsg(mdoc, n, MANDOCERR_IGNARGV);
 			break;
 		case (MDOC_Offset):
 			/* NB: this can be empty! */
Index: mdoc_argv.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_argv.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -Lmdoc_argv.c -Lmdoc_argv.c -u -p -r1.81 -r1.82
--- mdoc_argv.c
+++ mdoc_argv.c
@@ -81,7 +81,7 @@ static	const enum argvflag argvflags[MDO
 	ARGV_NONE,	/* MDOC_Ohang */
 	ARGV_NONE,	/* MDOC_Inset */
 	ARGV_MULTI,	/* MDOC_Column */
-	ARGV_SINGLE,	/* MDOC_Width */
+	ARGV_OPT_SINGLE, /* MDOC_Width */
 	ARGV_NONE,	/* MDOC_Compact */
 	ARGV_NONE,	/* MDOC_Std */
 	ARGV_NONE,	/* MDOC_Filled */
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-23  5:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-23  5:50 mdocml: Make the `-width' field to `Bl' not puke if it doesn't have an kristaps

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).