[vlc-commits] contrib: lua: don't use localeconv()

Rafaël Carré git at videolan.org
Sat Jan 21 23:03:21 CET 2012


vlc/vlc-1.2 | branch: master | Rafaël Carré <funman at videolan.org> | Thu Jan  5 04:13:26 2012 -0500| [9be1c37a14f2a7454bd240a4a473c7ffdb27aa14] | committer: Jean-Baptiste Kempf

contrib: lua: don't use localeconv()

not thread-safe, not available on android
just use '.' as decimal separator
(cherry picked from commit 6309ae8cb1f75aba2b6a5b3473dc635073c9ab3d)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=9be1c37a14f2a7454bd240a4a473c7ffdb27aa14
---

 contrib/src/lua/no-localeconv.patch |   13 +++++++++++++
 contrib/src/lua/rules.mak           |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/contrib/src/lua/no-localeconv.patch b/contrib/src/lua/no-localeconv.patch
new file mode 100644
index 0000000..02d67c0
--- /dev/null
+++ b/contrib/src/lua/no-localeconv.patch
@@ -0,0 +1,13 @@
+--- lua/src/llex.c.orig	2011-12-25 23:39:35.254829002 -0500
++++ lua/src/llex.c	2011-12-25 23:39:59.662829001 -0500
+@@ -176,9 +176,8 @@
+ 
+ static void trydecpoint (LexState *ls, SemInfo *seminfo) {
+   /* format error: try to update decimal point separator */
+-  struct lconv *cv = localeconv();
+   char old = ls->decpoint;
+-  ls->decpoint = (cv ? cv->decimal_point[0] : '.');
++  ls->decpoint = '.';
+   buffreplace(ls, old, ls->decpoint);  /* try updated decimal separator */
+   if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
+     /* format error with correct decimal point: no more options */
diff --git a/contrib/src/lua/rules.mak b/contrib/src/lua/rules.mak
index fc11618..765f4e2 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -33,6 +33,7 @@ lua: lua-$(LUA_VERSION).tar.gz .sum-lua
 	$(UNPACK)
 	$(APPLY) $(SRC)/lua/lua-noreadline.patch
 	$(APPLY) $(SRC)/lua/luac-32bits.patch
+	$(APPLY) $(SRC)/lua/no-localeconv.patch
 ifdef HAVE_MACOSX
 	(cd $(UNPACK_DIR) && \
 	sed -e 's%gcc%$(CC)%' \



More information about the vlc-commits mailing list