summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/lua/llex.c1
-rw-r--r--apps/plugins/lua/rocklib.c9
-rw-r--r--apps/plugins/lua/rocklua.c1
3 files changed, 10 insertions, 1 deletions
diff --git a/apps/plugins/lua/llex.c b/apps/plugins/lua/llex.c
index 3d0ca5b58e..85ac516be3 100644
--- a/apps/plugins/lua/llex.c
+++ b/apps/plugins/lua/llex.c
@@ -102,7 +102,6 @@ static const char *txtToken (LexState *ls, int token) {
102void luaX_lexerror (LexState *ls, const char *msg, int token) { 102void luaX_lexerror (LexState *ls, const char *msg, int token) {
103 char buff[MAXSRC]; 103 char buff[MAXSRC];
104 luaO_chunkid(buff, getstr(ls->source), MAXSRC); 104 luaO_chunkid(buff, getstr(ls->source), MAXSRC);
105 rb->splashf(3*HZ, "%d %c 0x%X", ls->linenumber, ls->linenumber, ls->linenumber);
106 msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg); 105 msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg);
107 if (token) 106 if (token)
108 luaO_pushfstring(ls->L, "%s near " LUA_QS, msg, txtToken(ls, token)); 107 luaO_pushfstring(ls->L, "%s near " LUA_QS, msg, txtToken(ls, token));
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index 1c6469641e..99bc44c9a4 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -406,6 +406,14 @@ RB_WRAP(filesize)
406 return 1; 406 return 1;
407} 407}
408 408
409RB_WRAP(file_exists)
410{
411 const char* path = luaL_checkstring(L, 1);
412 bool result = rb->file_exists(path);
413 lua_pushboolean(L, result);
414 return 1;
415}
416
409#define R(NAME) {#NAME, rock_##NAME} 417#define R(NAME) {#NAME, rock_##NAME}
410static const luaL_Reg rocklib[] = 418static const luaL_Reg rocklib[] =
411{ 419{
@@ -440,6 +448,7 @@ static const luaL_Reg rocklib[] =
440 R(rename), 448 R(rename),
441 R(ftruncate), 449 R(ftruncate),
442 R(filesize), 450 R(filesize),
451 R(file_exists),
443 452
444 /* Kernel */ 453 /* Kernel */
445 R(sleep), 454 R(sleep),
diff --git a/apps/plugins/lua/rocklua.c b/apps/plugins/lua/rocklua.c
index 4bb89ae29b..e72591445f 100644
--- a/apps/plugins/lua/rocklua.c
+++ b/apps/plugins/lua/rocklua.c
@@ -93,6 +93,7 @@ enum plugin_status plugin_start(const void* parameter)
93 dlmalloc_stats(); 93 dlmalloc_stats();
94 94
95 if (status) { 95 if (status) {
96 DEBUGF("%s\n", lua_tostring(L, -1));
96 rb->splashf(5 * HZ, "%s", lua_tostring(L, -1)); 97 rb->splashf(5 * HZ, "%s", lua_tostring(L, -1));
97 lua_pop(L, 1); 98 lua_pop(L, 1);
98 } 99 }