X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fi18n.c;h=60189ff76eb6e983c0958af83916a4bd1fe57469;hb=16ca75fe99859fdec9f214a0fb9c1a3ef58c8442;hp=fb3973f437bb737d0ba53011596da1f844588509;hpb=5d31af536467b5774fb04ebc998ef459e893f24c;p=pspp-builds.git diff --git a/src/libpspp/i18n.c b/src/libpspp/i18n.c index fb3973f4..60189ff7 100644 --- a/src/libpspp/i18n.c +++ b/src/libpspp/i18n.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "assertion.h" #include "hmapx.h" #include "hash-functions.h" @@ -56,6 +57,7 @@ create_iconv (const char* tocode, const char* fromcode) size_t hash; struct hmapx_node *node; struct converter *converter; + assert (fromcode); hash = hash_string (tocode, hash_string (fromcode, 0)); HMAPX_FOR_EACH_WITH_HASH (converter, node, hash, &map) @@ -68,7 +70,7 @@ create_iconv (const char* tocode, const char* fromcode) converter->fromcode = xstrdup (fromcode); converter->conv = iconv_open (tocode, fromcode); hmapx_insert (&map, converter, hash); - + /* I don't think it's safe to translate this string or to use messaging as the convertors have not yet been set up */ if ( (iconv_t) -1 == converter->conv && 0 != strcmp (tocode, fromcode)) @@ -196,7 +198,7 @@ i18n_init (void) #if HAVE_LC_PAPER setlocale (LC_PAPER, ""); #endif - bindtextdomain (PACKAGE, locale_dir); + bindtextdomain (PACKAGE, relocate(locale_dir)); textdomain (PACKAGE); #endif /* ENABLE_NLS */