aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lapi.c b/lapi.c
index 184b8dd7..bbba88a3 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1239,14 +1239,12 @@ LUA_API void lua_toclose (lua_State *L, int idx) {
1239LUA_API void lua_concat (lua_State *L, int n) { 1239LUA_API void lua_concat (lua_State *L, int n) {
1240 lua_lock(L); 1240 lua_lock(L);
1241 api_checknelems(L, n); 1241 api_checknelems(L, n);
1242 if (n >= 2) { 1242 if (n > 0)
1243 luaV_concat(L, n); 1243 luaV_concat(L, n);
1244 } 1244 else { /* nothing to concatenate */
1245 else if (n == 0) { /* push empty string */ 1245 setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); /* push empty string */
1246 setsvalue2s(L, L->top, luaS_newlstr(L, "", 0));
1247 api_incr_top(L); 1246 api_incr_top(L);
1248 } 1247 }
1249 /* else n == 1; nothing to do */
1250 luaC_checkGC(L); 1248 luaC_checkGC(L);
1251 lua_unlock(L); 1249 lua_unlock(L);
1252} 1250}