diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-02-25 11:30:21 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-02-25 11:30:21 -0300 |
commit | 295f7ac04e68ebd49908d9a188488e7b44912585 (patch) | |
tree | 1d2ce6a2da230fb0748fd2389552c60e86ccfcd8 | |
parent | 6318de80d3329a627ebeae706b661a73d94e708e (diff) | |
download | lua-295f7ac04e68ebd49908d9a188488e7b44912585.tar.gz lua-295f7ac04e68ebd49908d9a188488e7b44912585.tar.bz2 lua-295f7ac04e68ebd49908d9a188488e7b44912585.zip |
added 'stip' parameter to lua_dump/string.dump
-rw-r--r-- | lapi.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.197 2014/02/15 13:12:01 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.198 2014/02/19 13:51:09 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -1009,14 +1009,14 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, | |||
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | 1011 | ||
1012 | LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) { | 1012 | LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data, int strip) { |
1013 | int status; | 1013 | int status; |
1014 | TValue *o; | 1014 | TValue *o; |
1015 | lua_lock(L); | 1015 | lua_lock(L); |
1016 | api_checknelems(L, 1); | 1016 | api_checknelems(L, 1); |
1017 | o = L->top - 1; | 1017 | o = L->top - 1; |
1018 | if (isLfunction(o)) | 1018 | if (isLfunction(o)) |
1019 | status = luaU_dump(L, getproto(o), writer, data, 0); | 1019 | status = luaU_dump(L, getproto(o), writer, data, strip); |
1020 | else | 1020 | else |
1021 | status = 1; | 1021 | status = 1; |
1022 | lua_unlock(L); | 1022 | lua_unlock(L); |
@@ -1208,7 +1208,7 @@ static const char *aux_upvalue (StkId fi, int n, TValue **val, | |||
1208 | *val = f->upvals[n-1]->v; | 1208 | *val = f->upvals[n-1]->v; |
1209 | if (uv) *uv = f->upvals[n - 1]; | 1209 | if (uv) *uv = f->upvals[n - 1]; |
1210 | name = p->upvalues[n-1].name; | 1210 | name = p->upvalues[n-1].name; |
1211 | return (name == NULL) ? "" : getstr(name); | 1211 | return (name == NULL) ? "(*no name)" : getstr(name); |
1212 | } | 1212 | } |
1213 | default: return NULL; /* not a closure */ | 1213 | default: return NULL; /* not a closure */ |
1214 | } | 1214 | } |