source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Three fixes with respect to the names table: 1.
@ 2014-11-19 20:40 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-11-19 20:40 UTC (permalink / raw)
  To: source

Log Message:
-----------
Three fixes with respect to the names table:
1. Do not mask out NAME_FIRST before its first use.
2. Avoid duplicate NAME_FILE entries.
3. Correctly mask NAME_FILE for .so links.

Modified Files:
--------------
    mdocml:
        mandocdb.c

Revision Data
-------------
Index: mandocdb.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandocdb.c,v
retrieving revision 1.168
retrieving revision 1.169
diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.168 -r1.169
--- mandocdb.c
+++ mandocdb.c
@@ -138,6 +138,7 @@ struct	mdoc_handler {
 static	void	 dbclose(int);
 static	void	 dbadd(struct mpage *, struct mchars *);
 static	void	 dbadd_mlink(const struct mlink *mlink);
+static	void	 dbadd_mlink_name(const struct mlink *mlink);
 static	int	 dbopen(int);
 static	void	 dbprune(void);
 static	void	 filescan(const char *);
@@ -1153,7 +1154,7 @@ mpages_merge(struct mchars *mc, struct m
 					 */
 
 					if (mpage_dest->pageid)
-						dbadd_mlink(mlink);
+						dbadd_mlink_name(mlink);
 
 					if (NULL == mlink->next)
 						break;
@@ -1728,7 +1729,8 @@ putkeys(const struct mpage *mpage,
 	if (TYPE_Nm & v) {
 		htab = &names;
 		v &= name_mask;
-		name_mask &= ~NAME_FIRST;
+		if (v & NAME_FIRST)
+			name_mask &= ~NAME_FIRST;
 		if (debug > 1)
 			say(mpage->mlinks->file,
 			    "Adding name %*s", sz, cp);
@@ -1943,9 +1945,17 @@ dbadd_mlink(const struct mlink *mlink)
 	SQL_BIND_INT64(stmts[STMT_INSERT_LINK], i, mlink->mpage->pageid);
 	SQL_STEP(stmts[STMT_INSERT_LINK]);
 	sqlite3_reset(stmts[STMT_INSERT_LINK]);
+}
+
+static void
+dbadd_mlink_name(const struct mlink *mlink)
+{
+	size_t		 i;
+
+	dbadd_mlink(mlink);
 
 	i = 1;
-	SQL_BIND_INT64(stmts[STMT_INSERT_NAME], i, NAME_FILE);
+	SQL_BIND_INT64(stmts[STMT_INSERT_NAME], i, NAME_FILE & NAME_MASK);
 	SQL_BIND_TEXT(stmts[STMT_INSERT_NAME], i, mlink->name);
 	SQL_BIND_INT64(stmts[STMT_INSERT_NAME], i, mlink->mpage->pageid);
 	SQL_STEP(stmts[STMT_INSERT_NAME]);
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-11-19 20:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 20:40 mdocml: Three fixes with respect to the names table: 1 schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).