summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/lauxlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/lauxlib.c')
-rw-r--r--apps/plugins/lua/lauxlib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/plugins/lua/lauxlib.c b/apps/plugins/lua/lauxlib.c
index b8020b7475..9597f63c60 100644
--- a/apps/plugins/lua/lauxlib.c
+++ b/apps/plugins/lua/lauxlib.c
@@ -199,7 +199,7 @@ LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg,
199 return luaL_opt(L, luaL_checkinteger, narg, def); 199 return luaL_opt(L, luaL_checkinteger, narg, def);
200} 200}
201 201
202 202/* ROCKLUA ADDED */
203LUALIB_API int luaL_checkboolean (lua_State *L, int narg) { 203LUALIB_API int luaL_checkboolean (lua_State *L, int narg) {
204 int b = lua_toboolean(L, narg); 204 int b = lua_toboolean(L, narg);
205 if( b == 0 && !lua_isboolean(L, narg)) 205 if( b == 0 && !lua_isboolean(L, narg))
@@ -207,7 +207,7 @@ LUALIB_API int luaL_checkboolean (lua_State *L, int narg) {
207 return b; 207 return b;
208} 208}
209 209
210 210/* ROCKLUA ADDED */
211LUALIB_API int luaL_optboolean (lua_State *L, int narg, int def) { 211LUALIB_API int luaL_optboolean (lua_State *L, int narg, int def) {
212 return luaL_opt(L, luaL_checkboolean, narg, def); 212 return luaL_opt(L, luaL_checkboolean, narg, def);
213} 213}
@@ -538,7 +538,7 @@ typedef struct LoadF {
538 char buff[LUAL_BUFFERSIZE]; 538 char buff[LUAL_BUFFERSIZE];
539} LoadF; 539} LoadF;
540 540
541static const char *getF(lua_State *L, void *ud, size_t *size) { 541static const char *getF (lua_State *L, void *ud, size_t *size) {
542 LoadF *lf = (LoadF *)ud; 542 LoadF *lf = (LoadF *)ud;
543 (void)L; 543 (void)L;
544 if (lf->extraline) { 544 if (lf->extraline) {
@@ -547,7 +547,6 @@ static const char *getF(lua_State *L, void *ud, size_t *size) {
547 return "\n"; 547 return "\n";
548 } 548 }
549 *size = rb->read(lf->f, lf->buff, LUAL_BUFFERSIZE); 549 *size = rb->read(lf->f, lf->buff, LUAL_BUFFERSIZE);
550 if (*size <= 0) return NULL;
551 return (*size > 0) ? lf->buff : NULL; 550 return (*size > 0) ? lf->buff : NULL;
552} 551}
553 552