summaryrefslogtreecommitdiffstats
path: root/apropos.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-12-27 18:51:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-12-27 18:51:25 +0000
commitd8b402becc17ecde4e1ebe75eea8221fd42a162b (patch)
treeb6592c62f2c66ec51eadd067227d58db7ab3f8e3 /apropos.c
parentc5990883f0c591898575364a94056380526ffc11 (diff)
downloadmandoc-d8b402becc17ecde4e1ebe75eea8221fd42a162b.tar.gz
Change the mansearch() interface to use the mlinks table in the database
and return a list of names with sections, used by apropos(1) for display. While here, improve uniformity of the interface by allocating the file name dynamically, just like the names list and the description.
Diffstat (limited to 'apropos.c')
-rw-r--r--apropos.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apropos.c b/apropos.c
index cd97e779..52090f56 100644
--- a/apropos.c
+++ b/apropos.c
@@ -96,7 +96,9 @@ main(int argc, char *argv[])
goto usage;
for (i = 0; i < sz; i++) {
- printf("%s - %s\n", res[i].file, res[i].desc);
+ printf("%s - %s\n", res[i].names, res[i].desc);
+ free(res[i].file);
+ free(res[i].names);
free(res[i].desc);
}