diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2016-08-17 18:59:37 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2016-08-17 18:59:37 +0000 |
commit | eccbe40515e1ca229e250d389f02e0395c281098 (patch) | |
tree | 1a9e67925ac25b339a927582d29feca6acb42c78 /dba.c | |
parent | 77472d81dfad0b0e6e871a1beaf35cfcfd6a9067 (diff) | |
download | mandoc-eccbe40515e1ca229e250d389f02e0395c281098.tar.gz |
When reading back a mandoc.db(5) file in order to apply incremental
changes, do not prepend a stray NAME_FILE (0x10) byte to the first
names of pages.
Bug found while investigating another issue reported by sthen@.
Diffstat (limited to 'dba.c')
-rw-r--r-- | dba.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -143,7 +143,8 @@ dba_page_new(struct dba_array *pages, const char *name, const char *sect, page = dba_array_new(DBP_MAX, 0); entry = dba_array_new(1, DBA_STR | DBA_GROW); - dba_array_add(entry, prepend(name, NAME_FILE & NAME_MASK)); + if (name != NULL) + dba_array_add(entry, prepend(name, NAME_FILE & NAME_MASK)); dba_array_add(page, entry); entry = dba_array_new(1, DBA_STR | DBA_GROW); dba_array_add(entry, (void *)sect); |