summaryrefslogtreecommitdiffstats
path: root/tbl_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'tbl_data.c')
-rw-r--r--tbl_data.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/tbl_data.c b/tbl_data.c
index b50ce7f6..d5089d22 100644
--- a/tbl_data.c
+++ b/tbl_data.c
@@ -66,7 +66,7 @@ data(struct tbl *tbl, struct tbl_span *dp,
dat->flags |= TBL_DATA_NDHORIZ;
}
-struct tbl_span *
+int
tbl_data(struct tbl *tbl, int ln, const char *p)
{
struct tbl_span *dp;
@@ -76,21 +76,27 @@ tbl_data(struct tbl *tbl, int ln, const char *p)
if ('\0' == p[pos]) {
TBL_MSG(tbl, MANDOCERR_TBL, ln, pos);
- return(NULL);
+ return(1);
}
dp = mandoc_calloc(1, sizeof(struct tbl_span));
+ if (tbl->last_span) {
+ tbl->last_span->next = dp;
+ tbl->last_span = dp;
+ } else
+ tbl->last_span = tbl->first_span = dp;
+
if ( ! strcmp(p, "_")) {
dp->flags |= TBL_SPAN_HORIZ;
- return(dp);
+ return(1);
} else if ( ! strcmp(p, "=")) {
dp->flags |= TBL_SPAN_DHORIZ;
- return(dp);
+ return(1);
}
while ('\0' != p[pos])
data(tbl, dp, ln, p, &pos);
- return(dp);
+ return(1);
}