diff options
author | bartpolot <bartpolot@140774ce-b5e7-0310-ab8b-a85725594a96> | 2013-02-05 17:49:08 +0000 |
---|---|---|
committer | bartpolot <bartpolot@140774ce-b5e7-0310-ab8b-a85725594a96> | 2013-02-05 17:49:08 +0000 |
commit | 3c2d45918f7fb77caa44e1b3781e83a7549b1010 (patch) | |
tree | 213f7974f7696ae6588f042764b47b8e44a7278b | |
parent | afede7cb91e0ee78a395259cb5f09ca9354a18e1 (diff) |
- doc, fixes
git-svn-id: https://gnunet.org/svn/gnunet@26027 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r-- | src/regex/regex_test_lib.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/regex/regex_test_lib.c b/src/regex/regex_test_lib.c index 7a11fe05ec..88a76fa27c 100644 --- a/src/regex/regex_test_lib.c +++ b/src/regex/regex_test_lib.c @@ -28,13 +28,35 @@ #include "platform.h" #include "gnunet_util_lib.h" + +/** + * Struct to hold the tree formed by prefix-combining the regexes. + */ struct RegexCombineCtx { + + /** + * Next node with same prefix but different token. + */ struct RegexCombineCtx *next; + + /** + * Prev node with same prefix but different token. + */ struct RegexCombineCtx *prev; + /** + * First child node with same prefix and token. + */ struct RegexCombineCtx *head; + + /** + * Last child node. + */ struct RegexCombineCtx *tail; + /** + * Token. + */ char *s; }; @@ -258,10 +280,11 @@ GNUNET_REGEX_read_from_file (const char *filename) else { len -= 6; - buffer[len] = '\0'; + regex[len] = '\0'; } regex = GNUNET_realloc (regex, len + 1); GNUNET_array_grow (regexes, nr, nr + 1); + GNUNET_assert (NULL == regexes[nr - 2]); regexes[nr - 2] = regex; regexes[nr - 1] = NULL; regex = NULL; |