From 58f7533c9f4a757e9db71039330750a0b958f008 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 17 Aug 2016 18:59:37 +0000 Subject: 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@. --- dba_read.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'dba_read.c') diff --git a/dba_read.c b/dba_read.c index bf003fa9..b24bd2e7 100644 --- a/dba_read.c +++ b/dba_read.c @@ -1,4 +1,4 @@ -/* $Id: dba_read.c,v 1.2 2016/08/04 09:33:57 schwarze Exp $ */ +/* $Id: dba_read.c,v 1.3 2016/08/17 18:59:37 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * @@ -48,10 +48,9 @@ dba_read(const char *fname) dba = dba_new(npages < 128 ? 128 : npages); for (ip = 0; ip < npages; ip++) { pdata = dbm_page_get(ip); - page = dba_page_new(dba->pages, pdata->name, pdata->sect, + page = dba_page_new(dba->pages, NULL, pdata->sect, pdata->arch, pdata->desc, pdata->file + 1, *pdata->file); - cp = pdata->name; - while (*(cp = strchr(cp, '\0') + 1) != '\0') + for (cp = pdata->name; *cp != '\0'; cp = strchr(cp, '\0') + 1) dba_page_add(page, DBP_NAME, cp); cp = pdata->sect; while (*(cp = strchr(cp, '\0') + 1) != '\0') -- cgit v1.2.3