comparison src/gaimrc.c @ 1236:dcf9242241ee

[gaim-migrate @ 1246] fixing some plugin stuff committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 12 Dec 2000 11:31:58 +0000
parents a9cf2f61a7b1
children b5783215b245
comparison
equal deleted inserted replaced
1235:a9cf2f61a7b1 1236:dcf9242241ee
421 421
422 static void gaimrc_read_plugins(FILE *f) 422 static void gaimrc_read_plugins(FILE *f)
423 { 423 {
424 struct parse *p; 424 struct parse *p;
425 char buf[4096]; 425 char buf[4096];
426 GSList *load = NULL;
426 427
427 buf[0] = 0; 428 buf[0] = 0;
428 429
429 while (buf[0] != '}') 430 while (buf[0] != '}')
430 { 431 {
431 if (!fgets(buf, sizeof(buf), f)) 432 if (!fgets(buf, sizeof(buf), f))
432 return; 433 break;
433 434
434 if (buf[0] == '}') 435 if (buf[0] == '}')
435 return; 436 break;
436 437
437 p = parse_line(buf); 438 p = parse_line(buf);
438 if (!strcmp(p->option, "plugin")) 439 if (!strcmp(p->option, "plugin"))
439 { 440 {
440 load_plugin(p->value[0]); 441 load = g_slist_append(load, g_strdup(p->value[0]));
441 } 442 }
443 }
444 /* this is such a fucked up hack. the reason we do this is because after
445 * we load a plugin the gaimrc file gets rewrit. so we have to remember
446 * which ones to load before loading them. */
447 while (load) {
448 load_plugin(load->data);
449 g_free(load->data);
450 load = g_slist_remove(load, load->data);
442 } 451 }
443 } 452 }
444 #endif /* GAIM_PLUGINS */ 453 #endif /* GAIM_PLUGINS */
445 454
446 static struct aim_user *gaimrc_read_user(FILE *f) 455 static struct aim_user *gaimrc_read_user(FILE *f)