=================================================================== RCS file: /cvs/mandoc/Attic/mdoc_action.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -p -r1.56 -r1.57 --- mandoc/Attic/mdoc_action.c 2010/05/14 15:26:39 1.56 +++ mandoc/Attic/mdoc_action.c 2010/05/14 16:02:29 1.57 @@ -1,4 +1,4 @@ -/* $Id: mdoc_action.c,v 1.56 2010/05/14 15:26:39 kristaps Exp $ */ +/* $Id: mdoc_action.c,v 1.57 2010/05/14 16:02:29 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -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); }