Bugfix
* libmailutils/cfg/gocs.c (mu_gocs_register): Avoid registering same capability twice.
Showing
1 changed file
with
9 additions
and
5 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 | if (i == MAX_GOCS-1) | 255 | { |
256 | { | 256 | if (i == MAX_GOCS-1) |
257 | mu_error (_("gocs table overflow")); | 257 | { |
258 | abort (); | 258 | mu_error (_("gocs table overflow")); |
259 | } | 259 | abort (); |
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