summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2006-02-10 12:00:00 +0000
committerrepogen <>2006-02-10 12:00:00 +0000
commit69c6ee1f592c6588bc11a8e02811230e77e984cf (patch)
treeae575c9f18e9e50b14829ccffa1a85a3d165f08e /src
parent43fb64048e381a76d6cd363dedd9ccc8a85b9b31 (diff)
downloadlua-github-69c6ee1f592c6588bc11a8e02811230e77e984cf.tar.gz
Lua 5.1-rc45.1-rc4
Diffstat (limited to 'src')
-rw-r--r--src/lobject.c4
-rw-r--r--src/luaconf.h8
2 files changed, 7 insertions, 5 deletions
diff --git a/src/lobject.c b/src/lobject.c
index e83b5240..acde82cc 100644
--- a/src/lobject.c
+++ b/src/lobject.c
@@ -1,5 +1,5 @@
/*
-** $Id: lobject.c,v 2.21 2006/01/10 12:50:00 roberto Exp $
+** $Id: lobject.c,v 2.22 2006/02/10 17:43:52 roberto Exp $
** Some generic functions over Lua objects
** See Copyright Notice in lua.h
*/
@@ -91,6 +91,8 @@ int luaO_str2d (const char *s, lua_Number *result) {
char *endptr;
*result = lua_str2number(s, &endptr);
if (endptr == s) return 0; /* conversion failed */
+ if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */
+ *result = cast_num(strtoul(s, &endptr, 16));
if (*endptr == '\0') return 1; /* most common case */
while (isspace(cast(unsigned char, *endptr))) endptr++;
if (*endptr != '\0') return 0; /* invalid trailing characters? */
diff --git a/src/luaconf.h b/src/luaconf.h
index 3f3e2bbe..97a3e30c 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -1,5 +1,5 @@
/*
-** $Id: luaconf.h,v 1.80 2006/01/27 13:54:39 roberto Exp $
+** $Id: luaconf.h,v 1.81 2006/02/10 17:44:06 roberto Exp $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
@@ -650,9 +650,9 @@ union luai_Cast { double l_d; long l_l; };
#else
-#define lua_popen(L,c,m) \
- ((void)c, (void)m, luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
-#define lua_pclose(L,file) ((void)L, (void)file, 0)
+#define lua_popen(L,c,m) ((void)((void)c, m), \
+ luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
+#define lua_pclose(L,file) ((void)((void)L, file), 0)
#endif