Bugfix
* libmailutils/cfg/gocs.c (mu_gocs_register): Avoid registering same capability twice.
Showing
1 changed file
with
4 additions
and
0 deletions
... | @@ -252,11 +252,15 @@ mu_gocs_register (const char *capa, mu_gocs_init_fp init) | ... | @@ -252,11 +252,15 @@ mu_gocs_register (const char *capa, mu_gocs_init_fp init) |
252 | { | 252 | { |
253 | int i; | 253 | int i; |
254 | for (i = 0; _gocs_table[i].name; i++) | 254 | for (i = 0; _gocs_table[i].name; i++) |
255 | { | ||
255 | if (i == MAX_GOCS-1) | 256 | if (i == MAX_GOCS-1) |
256 | { | 257 | { |
257 | mu_error (_("gocs table overflow")); | 258 | mu_error (_("gocs table overflow")); |
258 | abort (); | 259 | abort (); |
259 | } | 260 | } |
261 | else if (strcmp (_gocs_table[i].name, capa) == 0) | ||
262 | return; | ||
263 | } | ||
260 | _gocs_table[i].name = capa; | 264 | _gocs_table[i].name = capa; |
261 | _gocs_table[i].init = init; | 265 | _gocs_table[i].init = init; |
262 | } | 266 | } | ... | ... |
-
Please register or sign in to post a comment