aboutsummaryrefslogtreecommitdiff
path: root/src/regex
diff options
context:
space:
mode:
authorMaximilian Szengel <gnunet@maxsz.de>2012-09-10 14:08:44 +0000
committerMaximilian Szengel <gnunet@maxsz.de>2012-09-10 14:08:44 +0000
commit7f718edba992449e5877156ce27ad78745489890 (patch)
tree7ba4bf9cd68feaf6e924dd2d16342827d1bd93a2 /src/regex
parent66482612e5420d19052412d46ce6b41ca3b00868 (diff)
downloadgnunet-7f718edba992449e5877156ce27ad78745489890.tar.gz
gnunet-7f718edba992449e5877156ce27ad78745489890.zip
removing temp file in graph test
Diffstat (limited to 'src/regex')
-rw-r--r--src/regex/regex.c6
-rw-r--r--src/regex/test_regex_graph_api.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/src/regex/regex.c b/src/regex/regex.c
index d60ffdc00..68313664d 100644
--- a/src/regex/regex.c
+++ b/src/regex/regex.c
@@ -2347,7 +2347,7 @@ GNUNET_REGEX_construct_dfa (const char *regex, const size_t len)
2347 struct GNUNET_REGEX_Context ctx; 2347 struct GNUNET_REGEX_Context ctx;
2348 struct GNUNET_REGEX_Automaton *dfa; 2348 struct GNUNET_REGEX_Automaton *dfa;
2349 struct GNUNET_REGEX_Automaton *nfa; 2349 struct GNUNET_REGEX_Automaton *nfa;
2350 struct GNUNET_REGEX_StateSet *nfa_set; 2350 struct GNUNET_REGEX_StateSet *nfa_start_eps_cls;
2351 2351
2352 GNUNET_REGEX_context_init (&ctx); 2352 GNUNET_REGEX_context_init (&ctx);
2353 2353
@@ -2369,8 +2369,8 @@ GNUNET_REGEX_construct_dfa (const char *regex, const size_t len)
2369 dfa->regex = GNUNET_strdup (regex); 2369 dfa->regex = GNUNET_strdup (regex);
2370 2370
2371 // Create DFA start state from epsilon closure 2371 // Create DFA start state from epsilon closure
2372 nfa_set = nfa_closure_create (nfa, nfa->start, 0); 2372 nfa_start_eps_cls = nfa_closure_create (nfa, nfa->start, 0);
2373 dfa->start = dfa_state_create (&ctx, nfa_set); 2373 dfa->start = dfa_state_create (&ctx, nfa_start_eps_cls);
2374 automaton_add_state (dfa, dfa->start); 2374 automaton_add_state (dfa, dfa->start);
2375 2375
2376 construct_dfa_states (&ctx, nfa, dfa, dfa->start); 2376 construct_dfa_states (&ctx, nfa, dfa, dfa->start);
diff --git a/src/regex/test_regex_graph_api.c b/src/regex/test_regex_graph_api.c
index 0f1b72b61..9e8e1fb16 100644
--- a/src/regex/test_regex_graph_api.c
+++ b/src/regex/test_regex_graph_api.c
@@ -27,6 +27,8 @@
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_regex_lib.h" 28#include "gnunet_regex_lib.h"
29 29
30#define KEEP_FILES 0
31
30/** 32/**
31 * Check if 'filename' exists and is not empty. 33 * Check if 'filename' exists and is not empty.
32 * 34 *
@@ -57,6 +59,11 @@ filecheck (const char *filename)
57 error++; 59 error++;
58 } 60 }
59 61
62 error += fclose (fp);
63
64 if (!KEEP_FILES)
65 unlink (filename);
66
60 return error; 67 return error;
61} 68}
62 69