diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-12-30 09:34:06 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-12-30 09:34:06 +0000 |
commit | e875ab2ae5330f3a0ed3e650ab2ea07460c2266a (patch) | |
tree | 594522ffb2684eb12a4f887266ea5a8eb5b9d576 /tbl_data.c | |
parent | f3fd4f5f1744aff75c7c584aa1f72da4dfbfb016 (diff) | |
download | mandoc-e875ab2ae5330f3a0ed3e650ab2ea07460c2266a.tar.gz |
Move clean-up of parsed tbl nodes into the tbl_clear() function, called
once per invocation.
Diffstat (limited to 'tbl_data.c')
-rw-r--r-- | tbl_data.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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); } |