1 diff -u -r ../transmission-2.82/libtransmission/variant.c ./libtransmission/variant.c
2 --- ../transmission-2.82/libtransmission/variant.c 2013-08-09 04:45:40.000000000 +0200
3 +++ ./libtransmission/variant.c 2014-02-10 17:30:57.000000000 +0100
9 #include <locale.h> /* setlocale() */
11 #include <unistd.h> /* write() */
13 #include <event2/buffer.h>
15 if (!success && tr_variantIsString (v))
23 /* the json spec requires a '.' decimal point regardless of locale */
25 tr_strlcpy (locale, setlocale (LC_NUMERIC, NULL), sizeof (locale));
26 setlocale (LC_NUMERIC, "POSIX");
28 d = strtod (getStr (v), &endptr);
30 setlocale (LC_NUMERIC, locale);
33 if ((success = (getStr (v) != endptr) && !*endptr))
35 @@ -1088,12 +1096,16 @@
37 tr_variantToBuf (const tr_variant * v, tr_variant_fmt fmt)
42 struct evbuffer * buf = evbuffer_new();
45 /* parse with LC_NUMERIC="C" to ensure a "." decimal separator */
46 tr_strlcpy (lc_numeric, setlocale (LC_NUMERIC, NULL), sizeof (lc_numeric));
47 setlocale (LC_NUMERIC, "C");
50 evbuffer_expand (buf, 4096); /* alloc a little memory to start off with */
55 /* restore the previous locale */
57 setlocale (LC_NUMERIC, lc_numeric);
62 @@ -1272,9 +1286,11 @@
67 /* parse with LC_NUMERIC="C" to ensure a "." decimal separator */
68 tr_strlcpy (lc_numeric, setlocale (LC_NUMERIC, NULL), sizeof (lc_numeric));
69 setlocale (LC_NUMERIC, "C");
79 /* restore the previous locale */
80 setlocale (LC_NUMERIC, lc_numeric);