aboutsummaryrefslogtreecommitdiff
path: root/loadlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'loadlib.c')
-rw-r--r--loadlib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/loadlib.c b/loadlib.c
index b9ac3761..41082e59 100644
--- a/loadlib.c
+++ b/loadlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: loadlib.c,v 1.51 2005/12/29 15:32:11 roberto Exp roberto $ 2** $Id: loadlib.c,v 1.52 2006/04/10 18:27:23 roberto Exp roberto $
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**
@@ -356,7 +356,7 @@ static const char *findfile (lua_State *L, const char *name,
356 path = lua_tostring(L, -1); 356 path = lua_tostring(L, -1);
357 if (path == NULL) 357 if (path == NULL)
358 luaL_error(L, LUA_QL("package.%s") " must be a string", pname); 358 luaL_error(L, LUA_QL("package.%s") " must be a string", pname);
359 lua_pushstring(L, ""); /* error accumulator */ 359 lua_pushliteral(L, ""); /* error accumulator */
360 while ((path = pushnexttemplate(L, path)) != NULL) { 360 while ((path = pushnexttemplate(L, path)) != NULL) {
361 const char *filename; 361 const char *filename;
362 filename = luaL_gsub(L, lua_tostring(L, -1), LUA_PATH_MARK, name); 362 filename = luaL_gsub(L, lua_tostring(L, -1), LUA_PATH_MARK, name);
@@ -462,7 +462,7 @@ static int ll_require (lua_State *L) {
462 lua_getfield(L, LUA_ENVIRONINDEX, "loaders"); 462 lua_getfield(L, LUA_ENVIRONINDEX, "loaders");
463 if (!lua_istable(L, -1)) 463 if (!lua_istable(L, -1))
464 luaL_error(L, LUA_QL("package.loaders") " must be a table"); 464 luaL_error(L, LUA_QL("package.loaders") " must be a table");
465 lua_pushstring(L, ""); /* error message accumulator */ 465 lua_pushliteral(L, ""); /* error message accumulator */
466 for (i=1; ; i++) { 466 for (i=1; ; i++) {
467 lua_rawgeti(L, -2, i); /* get a loader */ 467 lua_rawgeti(L, -2, i); /* get a loader */
468 if (lua_isnil(L, -1)) 468 if (lua_isnil(L, -1))
@@ -646,8 +646,8 @@ LUALIB_API int luaopen_package (lua_State *L) {
646 setpath(L, "path", LUA_PATH, LUA_PATH_DEFAULT); /* set field `path' */ 646 setpath(L, "path", LUA_PATH, LUA_PATH_DEFAULT); /* set field `path' */
647 setpath(L, "cpath", LUA_CPATH, LUA_CPATH_DEFAULT); /* set field `cpath' */ 647 setpath(L, "cpath", LUA_CPATH, LUA_CPATH_DEFAULT); /* set field `cpath' */
648 /* store config information */ 648 /* store config information */
649 lua_pushstring(L, LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" 649 lua_pushliteral(L, LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n"
650 LUA_EXECDIR "\n" LUA_IGMARK); 650 LUA_EXECDIR "\n" LUA_IGMARK);
651 lua_setfield(L, -2, "config"); 651 lua_setfield(L, -2, "config");
652 /* set field `loaded' */ 652 /* set field `loaded' */
653 luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 2); 653 luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 2);