diff options
author | Maximilian Szengel <gnunet@maxsz.de> | 2012-08-23 16:30:39 +0000 |
---|---|---|
committer | Maximilian Szengel <gnunet@maxsz.de> | 2012-08-23 16:30:39 +0000 |
commit | 09f394f4f8fc77de47857adf9b8630136d930005 (patch) | |
tree | a461aacf16a90e371fb41360d2c6e3c2305c856a /src/regex/regex_graph.c | |
parent | 701f3aaab234871e99915e41a57cae14da9f4b09 (diff) | |
download | gnunet-09f394f4f8fc77de47857adf9b8630136d930005.tar.gz gnunet-09f394f4f8fc77de47857adf9b8630136d930005.zip |
- added check for automaton traversal
- fixed a bug that caused nfa's state_count to be incorrect for certain regexes
- only compute scc's when coloring option is set
Diffstat (limited to 'src/regex/regex_graph.c')
-rw-r--r-- | src/regex/regex_graph.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/regex/regex_graph.c b/src/regex/regex_graph.c index 9223200c8..5db3780d0 100644 --- a/src/regex/regex_graph.c +++ b/src/regex/regex_graph.c | |||
@@ -315,12 +315,13 @@ GNUNET_REGEX_automaton_save_graph (struct GNUNET_REGEX_Automaton *a, | |||
315 | } | 315 | } |
316 | 316 | ||
317 | /* First add the SCCs to the automaton, so we can color them nicely */ | 317 | /* First add the SCCs to the automaton, so we can color them nicely */ |
318 | scc_tarjan (a); | 318 | if (GNUNET_YES == ctx.coloring) |
319 | scc_tarjan (a); | ||
319 | 320 | ||
320 | start = "digraph G {\nrankdir=LR\n"; | 321 | start = "digraph G {\nrankdir=LR\n"; |
321 | fwrite (start, strlen (start), 1, ctx.filep); | 322 | fwrite (start, strlen (start), 1, ctx.filep); |
322 | 323 | ||
323 | GNUNET_REGEX_automaton_traverse (a, a->start, | 324 | GNUNET_REGEX_automaton_traverse (a, a->start, NULL, NULL, |
324 | &GNUNET_REGEX_automaton_save_graph_step, | 325 | &GNUNET_REGEX_automaton_save_graph_step, |
325 | &ctx); | 326 | &ctx); |
326 | 327 | ||