diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-14 16:02:29 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-14 16:02:29 +0000 |
commit | a8abc3fbebee0c90a4f19d6803e0f90d313ba868 (patch) | |
tree | 7c6a8fe1ce8b82484ed3c8bdb6ce390a14127328 /mdoc_action.c | |
parent | 942a78c97b19b539fd3a3930bb50cdede29cd3a7 (diff) | |
download | mandoc-a8abc3fbebee0c90a4f19d6803e0f90d313ba868.tar.gz |
"Warn on unknown argument for .At and print it like [new] groff." (patch by Joerg Sonnenberger, ed. Kristaps)
Keep short-log of commits in index.sgml.
Document compatibility with new/old groff in mdoc.7.
Diffstat (limited to 'mdoc_action.c')
-rw-r--r-- | mdoc_action.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/mdoc_action.c b/mdoc_action.c index 4739e0b6..9d2a3420 100644 --- a/mdoc_action.c +++ b/mdoc_action.c @@ -382,15 +382,27 @@ post_st(POST_ARGS) static int post_at(POST_ARGS) { - struct mdoc_node *nn; - const char *p; + struct mdoc_node *nn; + const char *p, *q; + char *buf; + size_t sz; if (n->child) { assert(MDOC_TEXT == n->child->type); p = mdoc_a2att(n->child->string); - assert(p); - free(n->child->string); - n->child->string = mandoc_strdup(p); + if (p) { + free(n->child->string); + n->child->string = mandoc_strdup(p); + } else { + p = "AT&T UNIX "; + q = n->child->string; + sz = strlen(p) + strlen(q) + 1; + buf = mandoc_malloc(sz); + strlcpy(buf, p, sz); + strlcat(buf, q, sz); + free(n->child->string); + n->child->string = buf; + } return(1); } |