diff options
Diffstat (limited to 'src/plugins/custom/regmark/prefix_tree.c')
-rw-r--r-- | src/plugins/custom/regmark/prefix_tree.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/custom/regmark/prefix_tree.c b/src/plugins/custom/regmark/prefix_tree.c index 3af1ae283..4d593ebbc 100644 --- a/src/plugins/custom/regmark/prefix_tree.c +++ b/src/plugins/custom/regmark/prefix_tree.c @@ -69,6 +69,8 @@ add_string_common (prefix_tree_t *tree, const char *input, int skip_levels, gboo if (*input >= 'A' && *input <= 'Z') { num = *input - 'A'; if (cur_level < skip_levels) { + input ++; + cur_level ++; continue; } /* Go throught each level and check specified letter */ @@ -91,7 +93,7 @@ add_string_common (prefix_tree_t *tree, const char *input, int skip_levels, gboo g_strlcpy (tmp, orig, MIN (sizeof (tmp), cur_level + 1)); if ((res = (uintptr_t)g_tree_lookup (cur->leafs[num].data, tmp)) != 0) { if (! read_only) { - g_tree_insert (cur->leafs[num].data, tmp, GUINT_TO_POINTER (res + 1)); + g_tree_insert (cur->leafs[num].data, g_strdup (tmp), GUINT_TO_POINTER (res + 1)); } return res + 1; } |