diff options
author | 2020-04-02 14:55:29 +0000 | |
---|---|---|
committer | 2020-04-02 14:55:29 +0000 | |
commit | 5ff59bf791b756aed64d922ec73fb1cf55a89a44 (patch) | |
tree | c595a15bd918ef9e317297a6cecc53578a575856 /usr.bin/mandoc/mdoc_validate.c | |
parent | Remove iwm(4) 11n mode CCK Tx rate fallback. (diff) | |
download | wireguard-openbsd-5ff59bf791b756aed64d922ec73fb1cf55a89a44.tar.xz wireguard-openbsd-5ff59bf791b756aed64d922ec73fb1cf55a89a44.zip |
Copy tagged strings before marking hyphens as breakable.
For example, this makes ":tCo-processes" work in ksh(1).
Diffstat (limited to 'usr.bin/mandoc/mdoc_validate.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 689cab24a95..4b22e617e22 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_validate.c,v 1.296 2020/04/01 20:10:17 schwarze Exp $ */ +/* $OpenBSD: mdoc_validate.c,v 1.297 2020/04/02 14:55:29 schwarze Exp $ */ /* * Copyright (c) 2010-2020 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> @@ -2149,10 +2149,11 @@ post_rs(POST_ARGS) static void post_hyph(POST_ARGS) { - struct roff_node *nch; + struct roff_node *n, *nch; char *cp; - for (nch = mdoc->last->child; nch != NULL; nch = nch->next) { + n = mdoc->last; + for (nch = n->child; nch != NULL; nch = nch->next) { if (nch->type != ROFFT_TEXT) continue; cp = nch->string; @@ -2161,8 +2162,11 @@ post_hyph(POST_ARGS) while (*(++cp) != '\0') if (*cp == '-' && isalpha((unsigned char)cp[-1]) && - 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; + } } } |