summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/loadlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/loadlib.c')
-rw-r--r--apps/plugins/lua/loadlib.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/plugins/lua/loadlib.c b/apps/plugins/lua/loadlib.c
index 87873f133f..1e310beed1 100644
--- a/apps/plugins/lua/loadlib.c
+++ b/apps/plugins/lua/loadlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $ 2** $Id: loadlib.c,v 1.52.1.4 2009/09/09 13:17:16 roberto Exp $
3** Dynamic library loader for Lua 3** Dynamic library loader for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5** 5**
@@ -21,9 +21,9 @@
21#include "lauxlib.h" 21#include "lauxlib.h"
22#include "lualib.h" 22#include "lualib.h"
23#include "rocklib.h" 23#include "rocklib.h"
24#include "rocklibc.h"
24 25
25 26#define setprogdir(L) ((void)0) /* ROCKLUA ADDED */
26#define setprogdir(L) ((void)0)
27 27
28 28
29/* 29/*
@@ -54,7 +54,7 @@ static const char *pushnexttemplate (lua_State *L, const char *path) {
54 54
55static const char *findfile (lua_State *L, const char *name, 55static const char *findfile (lua_State *L, const char *name,
56 const char *pname) { 56 const char *pname) {
57 get_current_path(L, 2); 57 get_current_path(L, 2); /* ROCKLUA ADDED */
58 const char *current_path = lua_tostring(L, -1); 58 const char *current_path = lua_tostring(L, -1);
59 const char *path; 59 const char *path;
60 60
@@ -196,7 +196,7 @@ static void modinit (lua_State *L, const char *modname) {
196 lua_setfield(L, -2, "_M"); /* module._M = module */ 196 lua_setfield(L, -2, "_M"); /* module._M = module */
197 lua_pushstring(L, modname); 197 lua_pushstring(L, modname);
198 lua_setfield(L, -2, "_NAME"); 198 lua_setfield(L, -2, "_NAME");
199 dot = rb->strrchr(modname, '.'); /* look for last dot in module name */ 199 dot = strrchr(modname, '.'); /* look for last dot in module name */
200 if (dot == NULL) dot = modname; 200 if (dot == NULL) dot = modname;
201 else dot++; 201 else dot++;
202 /* set _PACKAGE as package name (full module name minus last part) */ 202 /* set _PACKAGE as package name (full module name minus last part) */
@@ -292,7 +292,7 @@ LUALIB_API int luaopen_package (lua_State *L) {
292 lua_pushvalue(L, -1); 292 lua_pushvalue(L, -1);
293 lua_replace(L, LUA_ENVIRONINDEX); 293 lua_replace(L, LUA_ENVIRONINDEX);
294 /* create `loaders' table */ 294 /* create `loaders' table */
295 lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1); 295 lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0);
296 /* fill it with pre-defined loaders */ 296 /* fill it with pre-defined loaders */
297 for (i=0; loaders[i] != NULL; i++) { 297 for (i=0; loaders[i] != NULL; i++) {
298 lua_pushcfunction(L, loaders[i]); 298 lua_pushcfunction(L, loaders[i]);