aboutsummaryrefslogtreecommitdiff
path: root/src/regex/regex.c
diff options
context:
space:
mode:
authorMaximilian Szengel <gnunet@maxsz.de>2012-04-10 14:37:53 +0000
committerMaximilian Szengel <gnunet@maxsz.de>2012-04-10 14:37:53 +0000
commit836020bfb15bd865fffacaf39a6183da285999f5 (patch)
treed80c39f8d0c301db4a62a7962900de34e0206556 /src/regex/regex.c
parent24199bfb61f162a0ce520e0b4061560c20ba84e5 (diff)
downloadgnunet-836020bfb15bd865fffacaf39a6183da285999f5.tar.gz
gnunet-836020bfb15bd865fffacaf39a6183da285999f5.zip
fix
Diffstat (limited to 'src/regex/regex.c')
-rw-r--r--src/regex/regex.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/regex/regex.c b/src/regex/regex.c
index 0ebce7a89..6f5b20cc2 100644
--- a/src/regex/regex.c
+++ b/src/regex/regex.c
@@ -403,7 +403,7 @@ automaton_merge_states (struct GNUNET_REGEX_Context *ctx,
403 for (t_check = s_check->transitions_head; NULL != t_check; 403 for (t_check = s_check->transitions_head; NULL != t_check;
404 t_check = t_check->next) 404 t_check = t_check->next)
405 { 405 {
406 if (s_check != s2 && s2 == t_check->state) 406 if (s_check != s1 && s2 == t_check->state)
407 t_check->state = s1; 407 t_check->state = s1;
408 } 408 }
409 } 409 }
@@ -1343,6 +1343,8 @@ GNUNET_REGEX_construct_dfa (const char *regex, const size_t len)
1343 dfa->start = dfa_state_create (&ctx, nfa_set); 1343 dfa->start = dfa_state_create (&ctx, nfa_set);
1344 automaton_add_state (dfa, dfa->start); 1344 automaton_add_state (dfa, dfa->start);
1345 GNUNET_array_append (dfa_stack->states, dfa_stack->len, dfa->start); 1345 GNUNET_array_append (dfa_stack->states, dfa_stack->len, dfa->start);
1346
1347 // Create dfa states by combining nfa states
1346 while (dfa_stack->len > 0) 1348 while (dfa_stack->len > 0)
1347 { 1349 {
1348 dfa_state = dfa_stack->states[dfa_stack->len - 1]; 1350 dfa_state = dfa_stack->states[dfa_stack->len - 1];
@@ -1385,7 +1387,7 @@ GNUNET_REGEX_construct_dfa (const char *regex, const size_t len)
1385 GNUNET_free (dfa_stack); 1387 GNUNET_free (dfa_stack);
1386 GNUNET_REGEX_automaton_destroy (nfa); 1388 GNUNET_REGEX_automaton_destroy (nfa);
1387 1389
1388 /*dfa_minimize (&ctx, dfa);*/ 1390 dfa_minimize (&ctx, dfa);
1389 1391
1390 return dfa; 1392 return dfa;
1391} 1393}