From 2e032226d7571e9349735733dd195cac9da3d43a Mon Sep 17 00:00:00 2001 From: Maximilian Szengel Date: Wed, 6 Jun 2012 15:00:59 +0000 Subject: [PATCH] removed unnecessary brackets --- src/regex/regex.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/regex/regex.c b/src/regex/regex.c index cd08b8dcd..20c496dd4 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]) -- 2.25.1