diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-07-15 14:47:34 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-07-15 14:47:34 -0300 |
| commit | 28419c43831078f517e66aded3d8afae80d73692 (patch) | |
| tree | c38a0851a976ed37b0998e916dbac3d2176489fc | |
| parent | 5bff2aaf473e06b884846125ea6f5a718e2177bc (diff) | |
| download | lua-28419c43831078f517e66aded3d8afae80d73692.tar.gz lua-28419c43831078f517e66aded3d8afae80d73692.tar.bz2 lua-28419c43831078f517e66aded3d8afae80d73692.zip | |
'luaL_tolstring' uses 'lua_tolstring' instead of 'lua_tostring' and
'lua_objlen'
| -rw-r--r-- | lauxlib.c | 7 |
1 files changed, 2 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lauxlib.c,v 1.188 2009/06/19 14:21:57 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.189 2009/07/15 17:26:14 roberto Exp roberto $ |
| 3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -629,8 +629,6 @@ LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) { | |||
| 629 | if (!luaL_callmeta(L, idx, "__tostring")) { /* no metafield? */ | 629 | if (!luaL_callmeta(L, idx, "__tostring")) { /* no metafield? */ |
| 630 | switch (lua_type(L, idx)) { | 630 | switch (lua_type(L, idx)) { |
| 631 | case LUA_TNUMBER: | 631 | case LUA_TNUMBER: |
| 632 | lua_pushstring(L, lua_tostring(L, idx)); | ||
| 633 | break; | ||
| 634 | case LUA_TSTRING: | 632 | case LUA_TSTRING: |
| 635 | lua_pushvalue(L, idx); | 633 | lua_pushvalue(L, idx); |
| 636 | break; | 634 | break; |
| @@ -646,8 +644,7 @@ LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) { | |||
| 646 | break; | 644 | break; |
| 647 | } | 645 | } |
| 648 | } | 646 | } |
| 649 | if (len) *len = lua_objlen(L, -1); | 647 | return lua_tolstring(L, -1, len); |
| 650 | return lua_tostring(L, -1); | ||
| 651 | } | 648 | } |
| 652 | 649 | ||
| 653 | 650 | ||
