tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* tbl(7) should allow comma-separated options
@ 2014-11-25  1:33 Anthony J. Bentley
  2014-11-25  5:52 ` Ingo Schwarze
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony J. Bentley @ 2014-11-25  1:33 UTC (permalink / raw)
  To: tech

Hi,

The following table (from nsdejavu(1)) displays incorrectly in mandoc.
Groff displays it correctly.

mandoc doesn't like the comma-separated options. Options after the
first one are currently ignored.

.TS
center,box;
l l.
foo bar
.TE

mandoc: foo.7:2:7: ERROR: bad table syntax

Here's a patch (but is it right?):


Index: tbl_opts.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/tbl_opts.c,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 tbl_opts.c
--- tbl_opts.c	20 Apr 2014 16:44:44 -0000	1.5
+++ tbl_opts.c	25 Nov 2014 01:29:42 -0000
@@ -178,7 +178,7 @@ again:	/*
 	 *
 	 * options	::= option_list [:space:]* [;][\n]
 	 * option_list	::= option option_tail
-	 * option_tail	::= [:space:]+ option_list |
+	 * option_tail	::= [,:space:]+ option_list |
 	 *		::= epsilon
 	 * option	::= [:alpha:]+ args
 	 * args		::= [:space:]* [(] [:alpha:]+ [)]
@@ -209,7 +209,7 @@ again:	/*
 
 	buf[i] = '\0';
 
-	while (isspace((unsigned char)p[*pos]))
+	while (isspace((unsigned char)p[*pos]) || p[*pos] == ',')
 		(*pos)++;
 
 	/*
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-25  6:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-25  1:33 tbl(7) should allow comma-separated options Anthony J. Bentley
2014-11-25  5:52 ` Ingo Schwarze
2014-11-25  6:42   ` Anthony J. Bentley

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).