diff options
author | szengel <szengel@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-06-06 15:00:59 +0000 |
---|---|---|
committer | szengel <szengel@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-06-06 15:00:59 +0000 |
commit | 26cfc257b6ccaca66213d034ad49235448e840ed (patch) | |
tree | 3eda4fc5ce0bbb27f17b23b1c32d8c3198436f1e /src/regex/regex.c | |
parent | 81cf3679c745d66a6d71c27b98685fd44b39aa00 (diff) |
removed unnecessary brackets
git-svn-id: https://gnunet.org/svn/gnunet@21788 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/regex/regex.c')
-rw-r--r-- | src/regex/regex.c | 14 |
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]) |