summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Albright <eric_albright@sil.org>2008-07-01 05:08:29 +0000
committerEric Albright <eric_albright@sil.org>2008-07-01 05:08:29 +0000
commitac39473a0f28b49e5af0daf080fecddff948a119 (patch)
treee0745a445534cab04c5d46af564e1ce5d7a9f927
parent6a89fed2e116f7af3e0dd99b622c0c8e726c987c (diff)
downloadenchant-ac39473a0f28b49e5af0daf080fecddff948a119.tar.gz
hook the configure_enchant_provider routine back up for aspell and only remove the providers methods if we can't late bind to either library name.
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@24318 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r--src/aspell/aspell_provider.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/aspell/aspell_provider.c b/src/aspell/aspell_provider.c
index 9df1bf9..6ccc5ad 100644
--- a/src/aspell/aspell_provider.c
+++ b/src/aspell/aspell_provider.c
@@ -400,7 +400,7 @@ static WCHAR* GetRegistryValue(HKEY baseKey, const WCHAR * uKeyName, const WCHAR
#endif
#if defined(_WIN32)
-gboolean try(EnchantProvider * me, const char *dir_name, const WCHAR *aspell_module_name)
+gboolean load_library(EnchantProvider * me, const char *dir_name, const WCHAR *aspell_module_name)
{
HMODULE aspell_module = NULL;
char* szModule;
@@ -446,22 +446,24 @@ gboolean try(EnchantProvider * me, const char *dir_name, const WCHAR *aspell_mod
if (aspell_module == NULL)
{
- /* we can't seem to load aspell. Avoid late binding problems later */
- g_warning("Unable to load library aspell-15.dll.");
- me->request_dict = NULL;
- me->dispose_dict = NULL;
- me->list_dicts = NULL;
- return FALSE;
+ return FALSE;
}
return TRUE;
}
#endif
-void configure_provider(EnchantProvider * me, const char *dir_name)
+void configure_enchant_provider(EnchantProvider * me, const char *dir_name)
{
#if defined(_WIN32)
- try(me, dir_name, L"aspell-15.dll") ||
- try(me, dir_name, L"libaspell-15.dll");
+ if(!load_library(me, dir_name, L"aspell-15.dll") &&
+ !load_library(me, dir_name, L"libaspell-15.dll"))
+ {
+ /* we can't seem to load aspell. Avoid late binding problems later */
+ g_warning("Unable to load library aspell-15.dll.");
+ me->request_dict = NULL;
+ me->dispose_dict = NULL;
+ me->list_dicts = NULL;
+ }
#endif
}