diff options
Diffstat (limited to 'pidgin/win32/wspell.c')
-rw-r--r-- | pidgin/win32/wspell.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/pidgin/win32/wspell.c b/pidgin/win32/wspell.c index 2e3cdcc93f..dec6f8dd23 100644 --- a/pidgin/win32/wspell.c +++ b/pidgin/win32/wspell.c @@ -73,25 +73,29 @@ void (*wpidginspell_recheck_all) (GtkSpell*) = wgtkspel static void load_gtkspell() { UINT old_error_mode = SetErrorMode(SEM_FAILCRITICALERRORS); gchar *tmp, *tmp2; + const char *path = g_getenv("PATH"); tmp = g_build_filename(wpurple_install_dir(), "spellcheck", NULL); - tmp2 = g_strdup_printf("%s%s%s", (path ? path : ""), + tmp2 = g_strdup_printf("%s%s%s", tmp, (path ? G_SEARCHPATH_SEPARATOR_S : ""), - tmp); + (path ? path : "")); g_free(tmp); g_setenv("PATH", tmp2, TRUE); + g_free(tmp2); + tmp = g_build_filename(wpurple_install_dir(), "spellcheck", GTKSPELL_DLL, NULL); /* Suppress error popups */ - wpidginspell_new_attach_proxy = (void*) wpurple_find_and_loadproc(GTKSPELL_DLL, "gtkspell_new_attach" ); + wpidginspell_new_attach_proxy = (void*) wpurple_find_and_loadproc(tmp, "gtkspell_new_attach" ); if (wpidginspell_new_attach_proxy) { - wpidginspell_get_from_text_view = (void*) wpurple_find_and_loadproc(GTKSPELL_DLL, "gtkspell_get_from_text_view"); - wpidginspell_detach = (void*) wpurple_find_and_loadproc(GTKSPELL_DLL, "gtkspell_detach"); - wpidginspell_set_language = (void*) wpurple_find_and_loadproc(GTKSPELL_DLL, "gtkspell_set_language"); - wpidginspell_recheck_all = (void*) wpurple_find_and_loadproc(GTKSPELL_DLL, "gtkspell_recheck_all"); + wpidginspell_get_from_text_view = (void*) wpurple_find_and_loadproc(tmp, "gtkspell_get_from_text_view"); + wpidginspell_detach = (void*) wpurple_find_and_loadproc(tmp, "gtkspell_detach"); + wpidginspell_set_language = (void*) wpurple_find_and_loadproc(tmp, "gtkspell_set_language"); + wpidginspell_recheck_all = (void*) wpurple_find_and_loadproc(tmp, "gtkspell_recheck_all"); } else { - purple_debug_warning("wspell", "Couldn't load gtkspell (%s) \n", GTKSPELL_DLL); + purple_debug_warning("wspell", "Couldn't load gtkspell (%s) \n", tmp); /*wpidginspell_new_attach = wgtkspell_new_attach;*/ } + g_free(tmp); SetErrorMode(old_error_mode); } |