Bug fix #143: GLSL shader error on European locales

Set LC_NUMERIC=C when generating GLSL shader strings to avoid decimal
point issues on European locales. Thanks to hiciu for reporting.
pull/2/head
Richard Grenville 11 years ago
parent 631f50d665
commit 9c609b9b97

@ -225,6 +225,11 @@ glx_init_blur(session_t *ps) {
#ifdef CONFIG_VSYNC_OPENGL_GLSL
{
char *lc_numeric_old = mstrcpy(setlocale(LC_NUMERIC, NULL));
// Enforce LC_NUMERIC locale "C" here to make sure decimal point is sane
// Thanks to hiciu for reporting.
setlocale(LC_NUMERIC, "C");
static const char *FRAG_SHADER_BLUR_PREFIX =
"#version 110\n"
"%s"
@ -331,6 +336,10 @@ glx_init_blur(session_t *ps) {
#undef P_GET_UNIFM_LOC
}
free(extension);
// Restore LC_NUMERIC
setlocale(LC_NUMERIC, lc_numeric_old);
free(lc_numeric_old);
}

@ -11,6 +11,7 @@
#include "common.h"
#include <ctype.h>
#include <locale.h>
#ifdef DEBUG_GLX_ERR

Loading…
Cancel
Save