diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 5 |
1 files changed, 5 insertions, 0 deletions
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, | |||
1339 | 1339 | ||
1340 | /* Find the longest match for the current string position, | 1340 | /* Find the longest match for the current string position, |
1341 | * among tokens in the given block */ | 1341 | * among tokens in the given block */ |
1342 | ctx->longest_match = 0; | ||
1342 | result = GNUNET_MESH_regex_block_iterate (block, size, | 1343 | result = GNUNET_MESH_regex_block_iterate (block, size, |
1343 | ®ex_edge_iterator, ctx); | 1344 | ®ex_edge_iterator, ctx); |
1344 | GNUNET_break (GNUNET_OK == result || SIZE_MAX == size); | 1345 | GNUNET_break (GNUNET_OK == result || SIZE_MAX == size); |
1345 | 1346 | ||
1347 | /* Did anything match? */ | ||
1348 | if (0 == ctx->longest_match) | ||
1349 | return; | ||
1350 | |||
1346 | new_ctx = GNUNET_malloc (sizeof (struct MeshRegexSearchContext)); | 1351 | new_ctx = GNUNET_malloc (sizeof (struct MeshRegexSearchContext)); |
1347 | new_ctx->info = info; | 1352 | new_ctx->info = info; |
1348 | new_ctx->position = ctx->position + ctx->longest_match; | 1353 | new_ctx->position = ctx->position + ctx->longest_match; |