# HG changeset patch # User Eric Warmenhoven # Date 976620718 0 # Node ID dcf9242241ee5934b346dac3bbd805667a8a6972 # Parent a9cf2f61a7b137a61ac891c195f30798fc30cc63 [gaim-migrate @ 1246] fixing some plugin stuff committer: Tailor Script diff -r a9cf2f61a7b1 -r dcf9242241ee src/gaimrc.c --- a/src/gaimrc.c Tue Dec 12 09:09:24 2000 +0000 +++ b/src/gaimrc.c Tue Dec 12 11:31:58 2000 +0000 @@ -423,23 +423,32 @@ { struct parse *p; char buf[4096]; + GSList *load = NULL; buf[0] = 0; while (buf[0] != '}') { if (!fgets(buf, sizeof(buf), f)) - return; + break; if (buf[0] == '}') - return; + break; p = parse_line(buf); if (!strcmp(p->option, "plugin")) { - load_plugin(p->value[0]); + load = g_slist_append(load, g_strdup(p->value[0])); } } + /* this is such a fucked up hack. the reason we do this is because after + * we load a plugin the gaimrc file gets rewrit. so we have to remember + * which ones to load before loading them. */ + while (load) { + load_plugin(load->data); + g_free(load->data); + load = g_slist_remove(load, load->data); + } } #endif /* GAIM_PLUGINS */ diff -r a9cf2f61a7b1 -r dcf9242241ee src/plugins.c --- a/src/plugins.c Tue Dec 12 09:09:24 2000 +0000 +++ b/src/plugins.c Tue Dec 12 11:31:58 2000 +0000 @@ -150,10 +150,10 @@ char *(*cfunc)(); char *error; char *retval; - char *tmp_filename; if (!g_module_supported()) return; if (filename == NULL) return; + if (strlen(filename) == 0) return; while (c) { plug = (struct gaim_plugin *)c->data; @@ -168,19 +168,13 @@ c = g_list_next(c); } plug = g_malloc(sizeof *plug); - if (!g_path_is_absolute(filename)) - tmp_filename = g_strconcat(g_get_home_dir(), G_DIR_SEPARATOR_S, - PLUGIN_DIR, filename, NULL); - else - tmp_filename = g_strdup(filename); if (last_dir) g_free(last_dir); - last_dir = g_dirname(tmp_filename); + last_dir = g_dirname(filename); - debug_printf("Loading %s\n", tmp_filename); - plug->handle = g_module_open(tmp_filename, 0); - g_free(tmp_filename); + debug_printf("Loading %s\n", filename); + plug->handle = g_module_open(filename, 0); if (!plug->handle) { error = (char *)g_module_error(); do_error_dialog(error, _("Plugin Error"));