diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-09-18 16:29:43 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-09-18 16:29:43 +0000 |
commit | 81c4a12b105773513b944f3385f74a1b6568da78 (patch) | |
tree | 412850be3c5dfc903e22eb7da083db2df5936c28 | |
parent | 32039d08a7fd13dfcbe5d5d1548a1482afc29187 (diff) | |
download | gnunet-81c4a12b105773513b944f3385f74a1b6568da78.tar.gz gnunet-81c4a12b105773513b944f3385f74a1b6568da78.zip |
- fix ghost regex bug
-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; |