i18n: Always allocate from pool in recode_substring_pool().
[pspp-builds.git] / src / libpspp / i18n.c
index 4934617121c786f5b19c6db88cc20e6f2033f116..59665bee63b6a44ba6910eea288d3ca8b1ae7b12 100644 (file)
@@ -208,7 +208,7 @@ recode_substring_pool (const char *to, const char *from,
   if ( (iconv_t) -1 == conv )
     {
       struct substring out;
-      ss_alloc_substring (&out, text);
+      ss_alloc_substring_pool (&out, text, pool);
       return out;
     }
 
@@ -229,17 +229,13 @@ recode_substring_pool (const char *to, const char *from,
 void
 i18n_init (void)
 {
-#if ENABLE_NLS
   setlocale (LC_CTYPE, "");
-#ifdef LC_MESSAGES
   setlocale (LC_MESSAGES, "");
-#endif
 #if HAVE_LC_PAPER
   setlocale (LC_PAPER, "");
 #endif
   bindtextdomain (PACKAGE, relocate(locale_dir));
   textdomain (PACKAGE);
-#endif /* ENABLE_NLS */
 
   assert (default_encoding == NULL);
   default_encoding = xstrdup (locale_charset ());