diff options
author | Dom Lachowicz <domlachowicz@gmail.com> | 2006-02-05 05:58:10 +0000 |
---|---|---|
committer | Dom Lachowicz <domlachowicz@gmail.com> | 2006-02-05 05:58:10 +0000 |
commit | ec4c41fc22c32147ef482e13d39e6907070eb48c (patch) | |
tree | 80803ff006d7a5c4042964f1a533934f9c2ffd0c | |
parent | 6fc285a37db93a14792fcaa8dfc71d9ce6a4bf98 (diff) | |
download | enchant-ec4c41fc22c32147ef482e13d39e6907070eb48c.tar.gz |
fix hspell crash; properly returns dictionary path and whether the dictionary exists or not
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@21101 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r-- | configure.in | 9 | ||||
-rw-r--r-- | src/hspell/hspell_provider.c | 23 |
2 files changed, 9 insertions, 23 deletions
diff --git a/configure.in b/configure.in index 0191224..66f091d 100644 --- a/configure.in +++ b/configure.in @@ -223,15 +223,8 @@ if test "x$check_hspell" != "xno"; then AC_CHECK_LIB(hspell,hspell_check_word,build_hspell=yes, build_hspell=no, -lz) fi -hspell_dir=${datadir}/hspell -AC_ARG_WITH(hspell-dir, [ --with-hspell-dir=PATH path to installed hspell dicts ]) - -if test "x$with_hspell_dir" != "x" ; then - hspell_dir=$with_hspell_dir -fi - HSPELL_LIBS=" -lhspell -lz" -HSPELL_CFLAGS="$HSPELL_CFLAGS -DENCHANT_HSPELL_DICT_DIR='\"$hspell_dir\"'" +#HSPELL_CFLAGS="$HSPELL_CFLAGS" AC_SUBST(HSPELL_CFLAGS) AC_SUBST(HSPELL_LIBS) diff --git a/src/hspell/hspell_provider.c b/src/hspell/hspell_provider.c index fbc48de..ee01a2b 100644 --- a/src/hspell/hspell_provider.c +++ b/src/hspell/hspell_provider.c @@ -228,27 +228,20 @@ static char ** hspell_provider_list_dicts (EnchantProvider * me, size_t * out_n_dicts) { + char * dictionary_path; char ** out_list = NULL; *out_n_dicts = 0; -#ifdef ENCHANT_HSPELL_DICT_DIR + dictionary_path = hspell_get_dictionary_path(); - { - char * hspell_dictionary; + if(dictionary_path && *dictionary_path && g_file_test (dictionary_path, G_FILE_TEST_EXISTS)) { + *out_n_dicts = 2; - hspell_dictionary = g_build_filename(ENCHANT_HSPELL_DICT_DIR, "hebrew.wgz"); - if(hspell_dictionary && g_file_test (hspell_dictionary, G_FILE_TEST_EXISTS)) { - *out_n_dicts = 2; - - out_list = g_new0 (char *, 3); - - out_list[0] = g_strdup ("he_IL"); - out_list[1] = g_strdup ("he"); - } + out_list = g_new0 (char *, 3); - g_free(hspell_dictionary); - } -#endif + out_list[0] = g_strdup ("he_IL"); + out_list[1] = g_strdup ("he"); + } return out_list; } |