=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_validate.c,v retrieving revision 1.296 retrieving revision 1.297 diff -c -r1.296 -r1.297 *** src/usr.bin/mandoc/mdoc_validate.c 2020/04/01 20:10:17 1.296 --- src/usr.bin/mandoc/mdoc_validate.c 2020/04/02 14:55:29 1.297 *************** *** 1,4 **** ! /* $OpenBSD: mdoc_validate.c,v 1.296 2020/04/01 20:10:17 schwarze Exp $ */ /* * Copyright (c) 2010-2020 Ingo Schwarze * Copyright (c) 2008-2012 Kristaps Dzonsons --- 1,4 ---- ! /* $OpenBSD: mdoc_validate.c,v 1.297 2020/04/02 14:55:29 schwarze Exp $ */ /* * Copyright (c) 2010-2020 Ingo Schwarze * Copyright (c) 2008-2012 Kristaps Dzonsons *************** *** 2149,2158 **** static void post_hyph(POST_ARGS) { ! struct roff_node *nch; char *cp; ! for (nch = mdoc->last->child; nch != NULL; nch = nch->next) { if (nch->type != ROFFT_TEXT) continue; cp = nch->string; --- 2149,2159 ---- static void post_hyph(POST_ARGS) { ! struct roff_node *n, *nch; char *cp; ! n = mdoc->last; ! for (nch = n->child; nch != NULL; nch = nch->next) { if (nch->type != ROFFT_TEXT) continue; cp = nch->string; *************** *** 2161,2168 **** while (*(++cp) != '\0') if (*cp == '-' && isalpha((unsigned char)cp[-1]) && ! isalpha((unsigned char)cp[1])) *cp = ASCII_HYPH; } } --- 2162,2172 ---- while (*(++cp) != '\0') if (*cp == '-' && isalpha((unsigned char)cp[-1]) && ! isalpha((unsigned char)cp[1])) { ! if (n->string == NULL && n->flags & NODE_ID) ! n->string = mandoc_strdup(nch->string); *cp = ASCII_HYPH; + } } }