summaryrefslogtreecommitdiffstats
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
commit0de54681d3f7151e2b9b98b64fe36571d47f3658 (patch)
treec78756114f47c95d43eb307b98202f6d2c984477
parent56b445d3928d35e9129387bfddeb64cd64cd421c (diff)
downloadmandoc-0de54681d3f7151e2b9b98b64fe36571d47f3658.tar.gz
Allow comma-separated options in tbl(7) tables.
Provides better groff compatibility. From bentley@.
-rw-r--r--tbl.71
-rw-r--r--tbl_opts.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/tbl.7 b/tbl.7
index 986ed674..99b50f20 100644
--- a/tbl.7
+++ b/tbl.7
@@ -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 86e0ed15..e13b349a 100644
--- a/tbl_opts.c
+++ b/tbl_opts.c
@@ -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)++;
/*