aboutsummaryrefslogtreecommitdiff
path: root/src/regex/regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex/regex.c')
-rw-r--r--src/regex/regex.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/regex/regex.c b/src/regex/regex.c
index cd08b8dcd2..20c496dd44 100644
--- a/src/regex/regex.c
+++ b/src/regex/regex.c
@@ -916,9 +916,17 @@ automaton_create_proofs (struct GNUNET_REGEX_Automaton *a)
if (NULL != R_last[k][k] && 0 != strcmp (R_last[k][k], ""))
{
- strcat (R_cur_r, "(");
- strcat (R_cur_r, R_last[k][k]);
- strcat (R_cur_r, ")*");
+ if (R_last[k][k][0] == '(' && R_last[k][k][strlen (R_last[k][k])-1] == ')')
+ {
+ strcat (R_cur_r, R_last[k][k]);
+ strcat (R_cur_r, "*");
+ }
+ else
+ {
+ strcat (R_cur_r, "(");
+ strcat (R_cur_r, R_last[k][k]);
+ strcat (R_cur_r, ")*");
+ }
}
if (NULL != R_last[k][j])