summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/apropos.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2011-12-28 01:17:02 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2011-12-28 01:17:02 +0000
commit0aeef74d98f5acf2d499d5a1b02a6de43ccbacab (patch)
tree8ea64e0fbbc2450ac49b77b6845f1685c86591b9 /usr.bin/mandoc/apropos.c
parent51f3ab9d216ddbbcac163c3af811a366a96976ad (diff)
Some parsing improvements from kristaps@:
* Accept multiple lines in cat page NAME parsing. * Do not trim the description to 70 characters in the database. * Instead, limit the length of the description during output. * In man(7), accept \-\- as a Nm-Nd separator; occurs in 3p.
Diffstat (limited to 'usr.bin/mandoc/apropos.c')
-rw-r--r--usr.bin/mandoc/apropos.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mandoc/apropos.c b/usr.bin/mandoc/apropos.c
index 7a0b18dc915..4b2e49719fd 100644
--- a/usr.bin/mandoc/apropos.c
+++ b/usr.bin/mandoc/apropos.c
@@ -1,4 +1,4 @@
-/* $Id: apropos.c,v 1.13 2011/12/26 12:45:58 schwarze Exp $ */
+/* $Id: apropos.c,v 1.14 2011/12/28 01:17:01 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -123,11 +123,11 @@ list(struct res *res, size_t sz, void *arg)
qsort(res, sz, sizeof(struct res), cmp);
for (i = 0; i < (int)sz; i++)
- printf("%s(%s%s%s) - %s\n", res[i].title,
+ printf("%s(%s%s%s) - %.*s\n", res[i].title,
res[i].cat,
*res[i].arch ? "/" : "",
*res[i].arch ? res[i].arch : "",
- res[i].desc);
+ 70, res[i].desc);
}
static int