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

Rafaël Carré git at videolan.org
Thu Jan 5 10:14:13 CET 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Thu Jan  5 04:13:26 2012 -0500| [6309ae8cb1f75aba2b6a5b3473dc635073c9ab3d] | committer: Rafaël Carré

contrib: lua: don't use localeconv()

not thread-safe, not available on android
just use '.' as decimal separator

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6309ae8cb1f75aba2b6a5b3473dc635073c9ab3d
---

 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