+
+ /*
+ * Build a title string for the file. If it matches
+ * the location of the file, remember the title as
+ * found; else, remember it as missing.
+ */
+
+ if (warnings) {
+ buf->len = 0;
+ buf_appendb(buf, mtitle, strlen(mtitle));
+ buf_appendb(buf, "(", 1);
+ buf_appendb(buf, msec, strlen(msec));
+ if ('\0' != *march) {
+ buf_appendb(buf, "/", 1);
+ buf_appendb(buf, march, strlen(march));
+ }
+ buf_appendb(buf, ")", 2);
+ for (p = buf->cp; '\0' != *p; p++)
+ *p = tolower(*p);
+ key.data = buf->cp;
+ key.size = buf->len;
+ val.data = NULL;
+ val.size = 0;
+ if (0 == skip)
+ val.data = emptystring;
+ else {
+ ch = (*files->get)(files, &key, &val, 0);
+ if (ch < 0) {
+ perror("hash");
+ exit((int)MANDOCLEVEL_SYSERR);
+ } else if (ch > 0) {
+ val.data = (void *)fn;
+ val.size = strlen(fn) + 1;
+ } else
+ val.data = NULL;
+ }
+ if (NULL != val.data &&
+ (*files->put)(files, &key, &val, 0) < 0) {
+ perror("hash");
+ exit((int)MANDOCLEVEL_SYSERR);
+ }
+ }