summaryrefslogtreecommitdiff
path: root/external/mit/lua/dist/src/liolib.c
diff options
context:
space:
mode:
authormbalmer <mbalmer@NetBSD.org>2015-10-08 13:21:00 +0000
committermbalmer <mbalmer@NetBSD.org>2015-10-08 13:21:00 +0000
commit649cf8e53381cbc6057d92bbf44588bb7024bdd2 (patch)
tree37d60c2028507b3425901810054e008ce1f65440 /external/mit/lua/dist/src/liolib.c
parent14a62719979f511f0c63a80b66d3ca7202ffc862 (diff)
update after conflict resolution
Diffstat (limited to 'external/mit/lua/dist/src/liolib.c')
-rw-r--r--external/mit/lua/dist/src/liolib.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/external/mit/lua/dist/src/liolib.c b/external/mit/lua/dist/src/liolib.c
index 65010dc41e1..a92f4e8edd8 100644
--- a/external/mit/lua/dist/src/liolib.c
+++ b/external/mit/lua/dist/src/liolib.c
@@ -1,5 +1,7 @@
+/* $NetBSD: liolib.c,v 1.4 2015/10/08 13:21:00 mbalmer Exp $ */
+
/*
-** $Id: liolib.c,v 1.3 2015/02/02 14:03:05 lneto Exp $
+** Id: liolib.c,v 2.144 2015/04/03 18:41:57 roberto Exp
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -410,12 +412,6 @@ static int readdigits (RN *rn, int hex) {
}
-/* access to locale "radix character" (decimal point) */
-#if !defined(l_getlocaledecpoint)
-#define l_getlocaledecpoint() (localeconv()->decimal_point[0])
-#endif
-
-
/*
** Read a number: first reads a valid prefix of a numeral into a buffer.
** Then it calls 'lua_stringtonumber' to check whether the format is
@@ -425,9 +421,10 @@ static int read_number (lua_State *L, FILE *f) {
RN rn;
int count = 0;
int hex = 0;
- char decp[2] = ".";
+ char decp[2];
rn.f = f; rn.n = 0;
- decp[0] = l_getlocaledecpoint(); /* get decimal point from locale */
+ decp[0] = lua_getlocaledecpoint(); /* get decimal point from locale */
+ decp[1] = '\0';
l_lockfile(rn.f);
do { rn.c = l_getc(rn.f); } while (isspace(rn.c)); /* skip spaces */
test2(&rn, "-+"); /* optional signal */
@@ -457,7 +454,7 @@ static int read_number (lua_State *L, FILE *f) {
static int test_eof (lua_State *L, FILE *f) {
int c = getc(f);
ungetc(c, f); /* no-op when c == EOF */
- lua_pushlstring(L, NULL, 0);
+ lua_pushliteral(L, "");
return (c != EOF);
}