summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-06-21 13:13:15 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-06-21 13:13:15 +0000
commit95941be4aefac838968002450363fc26c2ce094b (patch)
treec1103193d5bf17545fe29619245cfc203cb3c85a
parentdef18ef5006a69910ed1dcf005645809052c2b1e (diff)
downloadmandoc-95941be4aefac838968002450363fc26c2ce094b.tar.gz
Don't let empty strings into the makewhatis keyword database.
-rw-r--r--Makefile2
-rw-r--r--makewhatis.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index c535f105..86399a57 100644
--- a/Makefile
+++ b/Makefile
@@ -353,7 +353,7 @@ llib-lmandoc.ln: $(MANDOC_LNS)
# You'll need -ldb for Linux.
makewhatis: $(MAKEWHATIS_OBJS) libmandoc.a
- $(CC) -o $@ $(MAKEWHATIS_OBJS) libmandoc.a
+ $(CC) -o $@ $(MAKEWHATIS_OBJS) libmandoc.a -ldb
llib-lmakewhatis.ln: $(MAKEWHATIS_LNS)
$(LINT) $(LINTFLAGS) -Cmakewhatis $(MAKEWHATIS_LNS)
diff --git a/makewhatis.c b/makewhatis.c
index 8b1690d3..465e331b 100644
--- a/makewhatis.c
+++ b/makewhatis.c
@@ -792,7 +792,8 @@ hash_put(DB *db, const struct buf *buf, int mask)
int rc;
key.data = buf->cp;
- if (0 == (key.size = buf->len))
+
+ if ((key.size = buf->len) < 2)
return;
if ((rc = (*db->get)(db, &key, &val, 0)) < 0) {