diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-08 12:54:58 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-08 12:54:58 +0000 |
commit | ad29d8dbe925e8f0d680007ebf3c95aec8351f84 (patch) | |
tree | e1d347a6e1580d73cf7fb7e978c1b9103e0acbac /man_term.c | |
parent | d44fff44885ccb8313515cbafde42b061f7d4c45 (diff) | |
download | mandoc-ad29d8dbe925e8f0d680007ebf3c95aec8351f84.tar.gz |
make the internal a2roffsu() interface more powerful by returning
a pointer to the end of the parsed data, making it easier to
parse subsequent bytes
Diffstat (limited to 'man_term.c')
-rw-r--r-- | man_term.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -260,7 +260,7 @@ pre_PD(DECL_ARGS) return 0; } assert(n->type == ROFFT_TEXT); - if (a2roffsu(n->string, &su, SCALE_VS)) + if (a2roffsu(n->string, &su, SCALE_VS) != NULL) mt->pardist = term_vspan(p, &su); return 0; } @@ -374,7 +374,7 @@ pre_in(DECL_ARGS) else cp--; - if ( ! a2roffsu(++cp, &su, SCALE_EN)) + if (a2roffsu(++cp, &su, SCALE_EN) == NULL) return 0; v = (term_hspan(p, &su) + 11) / 24; @@ -425,7 +425,7 @@ pre_HP(DECL_ARGS) /* Calculate offset. */ if ((nn = n->parent->head->child) != NULL && - a2roffsu(nn->string, &su, SCALE_EN)) { + a2roffsu(nn->string, &su, SCALE_EN) != NULL) { len = term_hspan(p, &su) / 24; if (len < 0 && (size_t)(-len) > mt->offset) len = -mt->offset; @@ -510,7 +510,7 @@ pre_IP(DECL_ARGS) /* Calculate the offset from the optional second argument. */ if ((nn = n->parent->head->child) != NULL && (nn = nn->next) != NULL && - a2roffsu(nn->string, &su, SCALE_EN)) { + a2roffsu(nn->string, &su, SCALE_EN) != NULL) { len = term_hspan(p, &su) / 24; if (len < 0 && (size_t)(-len) > mt->offset) len = -mt->offset; @@ -592,7 +592,7 @@ pre_TP(DECL_ARGS) if ((nn = n->parent->head->child) != NULL && nn->string != NULL && ! (NODE_LINE & nn->flags) && - a2roffsu(nn->string, &su, SCALE_EN)) { + a2roffsu(nn->string, &su, SCALE_EN) != NULL) { len = term_hspan(p, &su) / 24; if (len < 0 && (size_t)(-len) > mt->offset) len = -mt->offset; @@ -796,7 +796,7 @@ pre_RS(DECL_ARGS) n->aux = SHRT_MAX + 1; if (n->child == NULL) n->aux = mt->lmargin[mt->lmargincur]; - else if (a2roffsu(n->child->string, &su, SCALE_EN)) + else if (a2roffsu(n->child->string, &su, SCALE_EN) != NULL) n->aux = term_hspan(p, &su) / 24; if (n->aux < 0 && (size_t)(-n->aux) > mt->offset) n->aux = -mt->offset; |