- if (keylist.count == 0 ||
- array_find(&keylist, keyid)) {
+ /*
+ * Only add the keys containing this word if this is
+ * our first pass (ie we have no existing key list),
+ * or the key contained a previous word.
+ */
+ if (firstpass || array_find(&keylist, keyid)) {