]> git.cameronkatri.com Git - mandoc.git/commitdiff
warn about missing one-line description;
authorIngo Schwarze <schwarze@openbsd.org>
Fri, 27 Jan 2017 11:33:26 +0000 (11:33 +0000)
committerIngo Schwarze <schwarze@openbsd.org>
Fri, 27 Jan 2017 11:33:26 +0000 (11:33 +0000)
missing feature found in the TODO file

mandocdb.c

index 26ea22f64d79887318eba817ee6613484712de06..dcfa43bd33e55a821026d6a33b236b80c92c556b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: mandocdb.c,v 1.241 2017/01/27 01:14:47 schwarze Exp $ */
+/*     $Id: mandocdb.c,v 1.242 2017/01/27 11:33:26 schwarze Exp $ */
 /*
  * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -1231,8 +1231,12 @@ mpages_merge(struct dba *dba, struct mparse *mp)
                        parse_mdoc(mpage, &man->meta, man->first);
                else
                        parse_man(mpage, &man->meta, man->first);
-               if (mpage->desc == NULL)
-                       mpage->desc = mandoc_strdup(mpage->mlinks->name);
+               if (mpage->desc == NULL) {
+                       mpage->desc = mandoc_strdup(mlink->name);
+                       if (warnings)
+                               say(mlink->file, "No one-line description, "
+                                   "using filename \"%s\"", mlink->name);
+               }
 
                for (mlink = mpage->mlinks;
                     mlink != NULL;
@@ -1360,7 +1364,8 @@ parse_cat(struct mpage *mpage, int fd)
                        /* Skip to next word. */ ;
        } else {
                if (warnings)
-                       say(mlink->file, "No dash in title line");
+                       say(mlink->file, "No dash in title line, "
+                           "reusing \"%s\" as one-line description", title);
                p = title;
        }