ServerShutdownModule_GETTEXT() was failing on non-locale-aware systems, fixed
authorArt Cancro <ajc@uncensored.citadel.org>
Mon, 23 May 2011 19:34:11 +0000 (15:34 -0400)
committerArt Cancro <ajc@uncensored.citadel.org>
Mon, 23 May 2011 19:34:11 +0000 (15:34 -0400)
webcit/gettext.c

index 382053a77804ed380c6c4239f537cf75e17fba82..43b8db26ed04bfcc9fbf110fee4f6162f39a1224 100644 (file)
@@ -41,7 +41,7 @@ const char *AvailLang[] = {
        ""
 };
 
-const char **AvailLangLoaded;
+const char **AvailLangLoaded = NULL;
 long nLocalesLoaded = 0;
 
 #ifdef HAVE_USELOCALE
@@ -379,22 +379,6 @@ void initialize_locales(void) {
 #endif
 }
 
-
-void 
-ServerShutdownModule_GETTEXT
-(void)
-{
-#ifdef HAVE_USELOCALE
-       int i;
-       for (i = 0; i < nLocalesLoaded; ++i) {
-               if (Empty_Locale != wc_locales[i])
-                       freelocale(wc_locales[i]);
-       }
-       free(wc_locales);
-#endif
-       free(AvailLangLoaded);
-}
-
 #else  /* ENABLE_NLS */
 const char *AvailLang[] = {
        "C", ""};
@@ -493,4 +477,20 @@ SessionDestroyModule_GETTEXT
 #ifdef ENABLE_NLS
        stop_selected_language();                               /* unset locale */
 #endif
+
+void 
+ServerShutdownModule_GETTEXT
+(void)
+{
+#ifdef HAVE_USELOCALE
+       int i;
+       for (i = 0; i < nLocalesLoaded; ++i) {
+               if (Empty_Locale != wc_locales[i])
+                       freelocale(wc_locales[i]);
+       }
+       free(wc_locales);
+#endif
+       if (!AvailLangLoaded) free(AvailLangLoaded);
+}
+
 }