From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 9c124a0f for ; Wed, 17 Aug 2016 14:00:08 -0500 (EST) Date: Wed, 17 Aug 2016 14:00:08 -0500 (EST) Message-Id: <3029857472960612873.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: When reading back a mandoc.db(5) file in order to apply X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- 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@. Modified Files: -------------- mdocml: dba.c dba_read.c Revision Data ------------- Index: dba_read.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/dba_read.c,v retrieving revision 1.2 retrieving revision 1.3 diff -Ldba_read.c -Ldba_read.c -u -p -r1.2 -r1.3 --- dba_read.c +++ dba_read.c @@ -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') Index: dba.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/dba.c,v retrieving revision 1.6 retrieving revision 1.7 diff -Ldba.c -Ldba.c -u -p -r1.6 -r1.7 --- dba.c +++ dba.c @@ -143,7 +143,8 @@ dba_page_new(struct dba_array *pages, co 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); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv