aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dba.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-07-29 15:23:57 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-07-29 15:23:57 +0000
commit6186d581cef14eeac47ae71fb343d8b6b1b5b013 (patch)
tree6c7d9b83f1f56cd44f575aee8f9c081217d9bd91 /dba.c
parentfd04a2530af452252677a5bf5b97f05788e91ba6 (diff)
downloadmandoc-6186d581cef14eeac47ae71fb343d8b6b1b5b013.tar.gz
mandoc-6186d581cef14eeac47ae71fb343d8b6b1b5b013.tar.zst
mandoc-6186d581cef14eeac47ae71fb343d8b6b1b5b013.zip
No need to populate the TYPE_arch and TYPE_sec bits, the information
is provided directly to dba_page_add() in dbadd_mlink() and to dba_page_new() in dbadd(). No need for a dedicated loop for NAME_FILE. It's done in dbadd_mlink() anyway. In this context, also record section numbers taken from filenames and from .Dt and .TH macros, architectures taken from .Dt macros, and fix the filtering of duplicate filename entries.
Diffstat (limited to 'dba.c')
-rw-r--r--dba.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/dba.c b/dba.c
index a9a48785..2fb2ab64 100644
--- a/dba.c
+++ b/dba.c
@@ -1,4 +1,4 @@
-/* $Id: dba.c,v 1.1 2016/07/19 21:31:55 schwarze Exp $ */
+/* $Id: dba.c,v 1.2 2016/07/29 15:23:57 schwarze Exp $ */
/*
* Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -175,9 +175,12 @@ dba_page_add(struct dba_array *page, int32_t ie, const char *str)
}
if (*str == '\0')
return;
- dba_array_FOREACH(entries, entry)
+ dba_array_FOREACH(entries, entry) {
+ if (ie == DBP_FILE && *entry < ' ')
+ entry++;
if (strcmp(entry, str) == 0)
return;
+ }
dba_array_add(entries, (void *)str);
}