index: mmap: add support for searching node

Almost a clean copy & paste from the previous implementation.
diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c
index c21eec7..b20aeec 100644
--- a/libkmod/libkmod-index.c
+++ b/libkmod/libkmod-index.c
@@ -717,3 +717,42 @@
 
 	return NULL;
 }
+
+static char *index_mm_search_node(struct index_mm_node *node, const char *key,
+									int i)
+{
+	char *value;
+	struct index_mm_node *child;
+	int ch;
+	int j;
+
+	while(node) {
+		for (j = 0; node->prefix[j]; j++) {
+			ch = node->prefix[j];
+
+			if (ch != key[i+j]) {
+				index_mm_free_node(node);
+				return NULL;
+			}
+		}
+
+		i += j;
+
+		if (key[i] == '\0') {
+			if (node->values) {
+				value = strdup(node->values[0].value);
+				index_mm_free_node(node);
+				return value;
+			} else {
+				return NULL;
+			}
+		}
+
+		child = index_mm_readchild(node, key[i]);
+		index_mm_free_node(node);
+		node = child;
+		i++;
+	}
+
+	return NULL;
+}