- /* strings with spaces are probably commands e.g. modprobe,
- with unique arguments. */
- if (strchr(str, ' ') != NULL)
- return add_new_string(rules, str, len + 1);
-
- /* descend root - start from last character of str */
- key = str[len - 1];
- node_off = rules->trie_root[key];
- depth = 0;
-
- /* descend suffix trie */
- if (node_off != 0) {
- while (1) {
- struct trie_node *node = &rules->trie[node_off];
- unsigned char child_slot;
-
- depth++;
- off = node->value_off + node->value_len - len;
-
- /* match against current node */
- if (depth == len ||
- (node->value_len >= len &&
- memcmp(&rules->buf[off], str, len) == 0))
- {
- return off;
- }
+ /* match against current node */
+ if (depth == len || (node->value_len >= len && memcmp(&rules->buf[off], str, len) == 0))
+ return off;