aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-11-26 17:51:55 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-11-26 17:51:55 +0000
commitbd11218f6075c362abe3732f284b777ea01c973e (patch)
tree380058367ae8e95d01119413e1745be37b381d44
parent26b89148b8de14db6d703f964e9dee45f469b8f6 (diff)
downloadmandoc-bd11218f6075c362abe3732f284b777ea01c973e.tar.gz
mandoc-bd11218f6075c362abe3732f284b777ea01c973e.tar.zst
mandoc-bd11218f6075c362abe3732f284b777ea01c973e.zip
Allow comma-separated options in tbl(7) tables.
Provides better groff compatibility. From bentley@.
-rw-r--r--tbl.75
-rw-r--r--tbl_opts.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/tbl.7 b/tbl.7
index 4073290c..04f5b47f 100644
--- a/tbl.7
+++ b/tbl.7
@@ -1,4 +1,4 @@
-.\" $Id: tbl.7,v 1.20 2014/10/14 02:16:06 schwarze Exp $
+.\" $Id: tbl.7,v 1.21 2014/11/26 17:51:55 schwarze Exp $
.\"
.\" Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: October 14 2014 $
+.Dd $Mdocdate: November 26 2014 $
.Dt TBL 7
.Os
.Sh NAME
@@ -135,6 +135,7 @@ in the case of
.Ss Options
The first line of a table consists of space-separated option keys and
modifiers terminated by a semicolon.
+For GNU compatibility, option keys can also be separated by commas.
If the first line does not have a terminating semicolon, it is assumed
that no options are specified and instead a
.Sx Layout
diff --git a/tbl_opts.c b/tbl_opts.c
index 10f33d41..d5ad42f7 100644
--- a/tbl_opts.c
+++ b/tbl_opts.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_opts.c,v 1.14 2014/08/10 23:54:41 schwarze Exp $ */
+/* $Id: tbl_opts.c,v 1.15 2014/11/26 17:51:55 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -182,7 +182,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:]+ [)]
@@ -213,7 +213,7 @@ again: /*
buf[i] = '\0';
- while (isspace((unsigned char)p[*pos]))
+ while (isspace((unsigned char)p[*pos]) || p[*pos] == ',')
(*pos)++;
/*