aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 8920ac9c..d36424d2 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.45 2001/01/25 16:45:36 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.46 2001/02/02 19:02:40 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*/
@@ -166,10 +166,8 @@ static void adjuststack (luaL_Buffer *B) {
166 } 166 }
167 else break; 167 else break;
168 } while (toget < B->level); 168 } while (toget < B->level);
169 if (toget >= 2) { 169 lua_concat(L, toget);
170 lua_concat(L, toget); 170 B->level = B->level - toget + 1;
171 B->level = B->level - toget + 1;
172 }
173 } 171 }
174} 172}
175 173
@@ -194,10 +192,7 @@ LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s) {
194 192
195LUALIB_API void luaL_pushresult (luaL_Buffer *B) { 193LUALIB_API void luaL_pushresult (luaL_Buffer *B) {
196 emptybuffer(B); 194 emptybuffer(B);
197 if (B->level == 0) 195 lua_concat(B->L, B->level);
198 lua_pushlstring(B->L, NULL, 0);
199 else if (B->level > 1)
200 lua_concat(B->L, B->level);
201 B->level = 1; 196 B->level = 1;
202} 197}
203 198