=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/tag.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- src/usr.bin/mandoc/tag.c 2018/10/23 20:41:59 1.20 +++ src/usr.bin/mandoc/tag.c 2018/11/22 11:30:15 1.21 @@ -1,4 +1,4 @@ -/* $OpenBSD: tag.c,v 1.20 2018/10/23 20:41:59 schwarze Exp $ */ +/* $OpenBSD: tag.c,v 1.21 2018/11/22 11:30:15 schwarze Exp $ */ /* * Copyright (c) 2015, 2016, 2018 Ingo Schwarze * @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -214,6 +215,11 @@ if (tag_files.tfd <= 0) return; + if (tag_files.tagname != NULL && ohash_find(&tag_data, + ohash_qlookup(&tag_data, tag_files.tagname)) == NULL) { + warnx("%s: no such tag", tag_files.tagname); + tag_files.tagname = NULL; + } stream = fdopen(tag_files.tfd, "w"); entry = ohash_first(&tag_data, &slot); while (entry != NULL) {