Commit ca52ce04 ca52ce046606cb72c29a771c0c28196a1aada964 by Sergey Poznyakoff

Bugfix

* libmailutils/cfg/gocs.c (mu_gocs_register): Avoid registering
same capability twice.
1 parent b60a5698
...@@ -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 }
......