浏览代码

main: use "C" locale for LC_NUMERIC

Some locales use ',' as decimal separator instead of '.', which is taken
into account by sscanf when parsing floating point values.

This can lead to parsing failures for the `colormatrix` and
`forwardmatrix` config options. Setting LC_NUMERIC to "C" solves this
problem.
Arnaud Ferraris 4 年之前
父节点
当前提交
e7d5da17cb
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      main.c

+ 3 - 0
main.c

@@ -15,6 +15,7 @@
 #include <wordexp.h>
 #include <gtk/gtk.h>
 #include <tiffio.h>
+#include <locale.h>
 #include "config.h"
 #include "ini.h"
 #include "quickdebayer.h"
@@ -1466,6 +1467,8 @@ main(int argc, char *argv[])
 		return ret;
 	}
 
+	setenv("LC_NUMERIC", "C", 1);
+
 	TIFFSetTagExtender(register_custom_tiff_tags);
 
 	gtk_init(&argc, &argv);