]> git.cameronkatri.com Git - mandoc.git/blobdiff - tag.c
clarify the difference between .Cm and .Ic;
[mandoc.git] / tag.c
diff --git a/tag.c b/tag.c
index 823f2045760bc43600b71a2a20d66be742fb3662..473ea7b6f4913fb3433d3edc77b510fdb801c104 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -1,4 +1,4 @@
-/*     $Id: tag.c,v 1.20 2018/10/23 20:42:37 schwarze Exp $ */
+/*     $Id: tag.c,v 1.21 2018/11/22 11:30:23 schwarze Exp $ */
 /*
  * Copyright (c) 2015, 2016, 2018 Ingo Schwarze <schwarze@openbsd.org>
  *
@@ -18,6 +18,9 @@
 
 #include <sys/types.h>
 
+#if HAVE_ERR
+#include <err.h>
+#endif
 #include <limits.h>
 #include <signal.h>
 #include <stddef.h>
@@ -216,6 +219,11 @@ tag_write(void)
 
        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) {