Annotation of ports/games/ufoai/base/patches/patch-src_ports_unix_unix_main_c, Revision 1.1
1.1 ! yason 1:
! 2: XXX: OpenBSD's locale support is very limited. This can probably
! 3: be removed when support for LC_MESSAGES is added.
! 4:
! 5: $OpenBSD$
! 6: --- src/ports/unix/unix_main.c.orig Tue May 17 12:21:10 2011
! 7: +++ src/ports/unix/unix_main.c Tue May 17 12:32:54 2011
! 8: @@ -140,9 +140,14 @@ const char *Sys_SetLocale (const char *localeID)
! 9: }
! 10: # endif /* __APPLE__ */
! 11:
! 12: +# ifdef __OpenBSD__
! 13: + if (Sys_Setenv("LC_ALL", localeID) != 0)
! 14: + Com_Printf("...setenv for LC_ALL failed: %s\n", localeID);
! 15: +# endif /* __OpenBSD__ */
! 16: +
! 17: /* set to system default */
! 18: setlocale(LC_ALL, "C");
! 19: - locale = setlocale(LC_MESSAGES, localeID);
! 20: + locale = setlocale(LC_ALL, localeID);
! 21: if (!locale) {
! 22: Com_DPrintf(DEBUG_CLIENT, "...could not set to language: %s\n", localeID);
! 23: locale = setlocale(LC_MESSAGES, "");
! 24: @@ -160,7 +165,7 @@ const char *Sys_SetLocale (const char *localeID)
! 25: const char *Sys_GetLocale (void)
! 26: {
! 27: /* Calling with NULL param should return current system settings. */
! 28: - const char *currentLocale = setlocale(LC_MESSAGES, NULL);
! 29: + const char *currentLocale = setlocale(LC_ALL, NULL);
! 30: if (currentLocale != NULL && currentLocale[0] != '\0')
! 31: return currentLocale;
! 32: else
CVSweb