comparison libpurple/plugin.c @ 15901:ab2f466b6a13

Get rid of an unnecessary strdup
author Mark Doliner <mark@kingant.net>
date Sun, 25 Mar 2007 00:45:40 +0000
parents 80ee585fb53c
children 2b8d4fabc103
comparison
equal deleted inserted replaced
15900:9cfe41743c65 15901:ab2f466b6a13
367 purple_debug_error("plugins", "%s is not loadable: The UI requirement is not met.\n", plugin->path); 367 purple_debug_error("plugins", "%s is not loadable: The UI requirement is not met.\n", plugin->path);
368 plugin->unloadable = TRUE; 368 plugin->unloadable = TRUE;
369 return plugin; 369 return plugin;
370 } 370 }
371 371
372 /* 372 /*
373 * Check to make sure a plugin has defined an id. 373 * Check to make sure a plugin has defined an id.
374 * Not having this check caused purple_plugin_unload to 374 * Not having this check caused purple_plugin_unload to
375 * enter an infinite loop in certain situations by passing 375 * enter an infinite loop in certain situations by passing
376 * purple_find_plugin_by_id a NULL value. -- ecoffey 376 * purple_find_plugin_by_id a NULL value. -- ecoffey
377 */ 377 */
378 if (!plugin->info->id || !strcmp(plugin->info->id, "")) 378 if (!plugin->info->id || !strcmp(plugin->info->id, ""))
379 { 379 {
380 plugin->error = g_strdup_printf(_("This plugin has not defined an ID.")); 380 plugin->error = g_strdup_printf(_("This plugin has not defined an ID."));
381 purple_debug_error("plugins", "%s is not loadable: info->id is not defined.\n", plugin->path); 381 purple_debug_error("plugins", "%s is not loadable: info->id is not defined.\n", plugin->path);
382 plugin->unloadable = TRUE; 382 plugin->unloadable = TRUE;
670 670
671 if (dep_plugin != NULL && purple_plugin_is_loaded(dep_plugin)) 671 if (dep_plugin != NULL && purple_plugin_is_loaded(dep_plugin))
672 { 672 {
673 if (!purple_plugin_unload(dep_plugin)) 673 if (!purple_plugin_unload(dep_plugin))
674 { 674 {
675 char *translated_name = g_strdup(_(dep_plugin->info->name));
676 char *tmp; 675 char *tmp;
677 676
678 tmp = g_strdup_printf(_("The dependent plugin %s failed to unload."), 677 tmp = g_strdup_printf(_("The dependent plugin %s failed to unload."),
679 translated_name); 678 _(dep_plugin->info->name));
680 g_free(translated_name);
681 679
682 purple_notify_error(NULL, NULL, 680 purple_notify_error(NULL, NULL,
683 _("There were errors unloading the plugin."), tmp); 681 _("There were errors unloading the plugin."), tmp);
684 g_free(tmp); 682 g_free(tmp);
685 } 683 }