summaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-05-27 14:11:27 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-05-27 14:11:27 -0300
commit57f8414de1968b6f9f212140f2da14cba3b6dacb (patch)
treef7ee1e6e09a272046f2897bd12d77fb1d1548136 /lapi.c
parent139d562861a939ef0a8456c84874b783a7861a24 (diff)
downloadlua-57f8414de1968b6f9f212140f2da14cba3b6dacb.tar.gz
lua-57f8414de1968b6f9f212140f2da14cba3b6dacb.tar.bz2
lua-57f8414de1968b6f9f212140f2da14cba3b6dacb.zip
small bug in 'luaV_concat' (L->top was left incorrect in some cases)
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lapi.c b/lapi.c
index 69307a3c..ec26006b 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.75 2009/04/17 14:28:06 roberto Exp roberto $ 2** $Id: lapi.c,v 2.76 2009/04/17 22:00:01 roberto Exp $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -1017,8 +1017,7 @@ LUA_API void lua_concat (lua_State *L, int n) {
1017 api_checknelems(L, n); 1017 api_checknelems(L, n);
1018 if (n >= 2) { 1018 if (n >= 2) {
1019 luaC_checkGC(L); 1019 luaC_checkGC(L);
1020 luaV_concat(L, n, cast_int(L->top - L->base) - 1); 1020 luaV_concat(L, n);
1021 L->top -= (n-1);
1022 } 1021 }
1023 else if (n == 0) { /* push empty string */ 1022 else if (n == 0) { /* push empty string */
1024 setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); 1023 setsvalue2s(L, L->top, luaS_newlstr(L, "", 0));