mirror of
https://github.com/lua/lua
synced 2025-04-18 19:02:47 +03:00
no need to avoid calling ctype functions as now they are implemented
by us (no inefficiencies due to accessing locale information)
This commit is contained in:
parent
b7be05ad27
commit
cf22133b69
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lobject.c,v 2.37 2010/04/05 16:26:37 roberto Exp roberto $
|
** $Id: lobject.c,v 2.38 2010/04/13 20:48:12 roberto Exp roberto $
|
||||||
** Some generic functions over Lua objects
|
** Some generic functions over Lua objects
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -112,10 +112,8 @@ int luaO_str2d (const char *s, lua_Number *result) {
|
|||||||
if (endptr == s) return 0; /* conversion failed */
|
if (endptr == s) return 0; /* conversion failed */
|
||||||
if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */
|
if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */
|
||||||
*result = cast_num(strtoul(s, &endptr, 16));
|
*result = cast_num(strtoul(s, &endptr, 16));
|
||||||
if (*endptr == '\0') return 1; /* most common case */
|
|
||||||
while (lisspace(cast(unsigned char, *endptr))) endptr++;
|
while (lisspace(cast(unsigned char, *endptr))) endptr++;
|
||||||
if (*endptr != '\0') return 0; /* invalid trailing characters? */
|
return (*endptr == '\0'); /* OK if no trailing characters */
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user