diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-12-27 18:42:25 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-12-27 18:42:25 +0000 |
commit | c5990883f0c591898575364a94056380526ffc11 (patch) | |
tree | b9a6f29658ce8d964529a0eb8b62453243c2e4ac | |
parent | c766f66a5a38d4d94ca953ff918c04ee9c2b95ca (diff) | |
download | mandoc-c5990883f0c591898575364a94056380526ffc11.tar.gz |
Save the MLINK name into the database, too;
apropos(1) will need it to display its results.
-rw-r--r-- | mandocdb.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1806,9 +1806,10 @@ dbindex(const struct mpage *mpage, struct mchars *mc) for (mlink = mpage->mlinks; mlink; mlink = mlink->next) { i = 1; + SQL_BIND_TEXT(stmts[STMT_INSERT_LINK], i, mlink->file); SQL_BIND_TEXT(stmts[STMT_INSERT_LINK], i, mlink->dsec); SQL_BIND_TEXT(stmts[STMT_INSERT_LINK], i, mlink->arch); - SQL_BIND_TEXT(stmts[STMT_INSERT_LINK], i, mlink->file); + SQL_BIND_TEXT(stmts[STMT_INSERT_LINK], i, mlink->name); SQL_BIND_INT64(stmts[STMT_INSERT_LINK], i, recno); SQL_STEP(stmts[STMT_INSERT_LINK]); sqlite3_reset(stmts[STMT_INSERT_LINK]); @@ -1948,6 +1949,7 @@ dbopen(int real) ");\n" "\n" "CREATE TABLE \"mlinks\" (\n" + " \"file\" TEXT NOT NULL,\n" " \"sec\" TEXT NOT NULL,\n" " \"arch\" TEXT NOT NULL,\n" " \"name\" TEXT NOT NULL,\n" @@ -1980,7 +1982,7 @@ prepare_statements: "(file,sec,arch,desc,form) VALUES (?,?,?,?,?)"; sqlite3_prepare_v2(db, sql, -1, &stmts[STMT_INSERT_PAGE], NULL); sql = "INSERT INTO mlinks " - "(sec,arch,name,pageid) VALUES (?,?,?,?)"; + "(file,sec,arch,name,pageid) VALUES (?,?,?,?,?)"; sqlite3_prepare_v2(db, sql, -1, &stmts[STMT_INSERT_LINK], NULL); sql = "INSERT INTO keys " "(bits,key,pageid) VALUES (?,?,?)"; |