From 81c4a12b105773513b944f3385f74a1b6568da78 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Tue, 18 Sep 2012 16:29:43 +0000 Subject: - fix ghost regex bug --- src/mesh/gnunet-service-mesh.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index e185d0cd4..3163615d2 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -1339,10 +1339,15 @@ regex_next_edge (const struct MeshRegexBlock *block, /* Find the longest match for the current string position, * among tokens in the given block */ + ctx->longest_match = 0; result = GNUNET_MESH_regex_block_iterate (block, size, ®ex_edge_iterator, ctx); GNUNET_break (GNUNET_OK == result || SIZE_MAX == size); + /* Did anything match? */ + if (0 == ctx->longest_match) + return; + new_ctx = GNUNET_malloc (sizeof (struct MeshRegexSearchContext)); new_ctx->info = info; new_ctx->position = ctx->position + ctx->longest_match; -- cgit v1.2.3