=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/Attic/mdoc_action.c,v retrieving revision 1.33 retrieving revision 1.34 diff -c -r1.33 -r1.34 *** src/usr.bin/mandoc/Attic/mdoc_action.c 2010/05/14 19:52:43 1.33 --- src/usr.bin/mandoc/Attic/mdoc_action.c 2010/05/15 16:48:12 1.34 *************** *** 1,4 **** ! /* $Id: mdoc_action.c,v 1.33 2010/05/14 19:52:43 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: mdoc_action.c,v 1.34 2010/05/15 16:48:12 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * *************** *** 362,370 **** assert(MDOC_TEXT == n->child->type); p = mdoc_a2st(n->child->string); ! assert(p); ! free(n->child->string); ! n->child->string = mandoc_strdup(p); return(1); } --- 362,371 ---- assert(MDOC_TEXT == n->child->type); p = mdoc_a2st(n->child->string); ! if (p != NULL) { ! free(n->child->string); ! n->child->string = mandoc_strdup(p); ! } return(1); } *************** *** 377,391 **** static int post_at(POST_ARGS) { ! struct mdoc_node *nn; ! const char *p; 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); return(1); } --- 378,404 ---- static int post_at(POST_ARGS) { ! 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); ! 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); }