diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-08-09 14:58:09 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-08-09 14:58:09 -0300 |
commit | ab3dfa55948a670c35152ffd965d218ad48f871a (patch) | |
tree | e88baf3ef8784c2870a5f623e9e512f284efd35e | |
parent | 62f786e08cd4364b199f9dd1e5f2d989d04a243a (diff) | |
download | lua-ab3dfa55948a670c35152ffd965d218ad48f871a.tar.gz lua-ab3dfa55948a670c35152ffd965d218ad48f871a.tar.bz2 lua-ab3dfa55948a670c35152ffd965d218ad48f871a.zip |
store some configuration information
-rw-r--r-- | loadlib.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loadlib.c,v 1.34 2005/07/13 19:02:42 roberto Exp roberto $ | 2 | ** $Id: loadlib.c,v 1.35 2005/08/01 04:21:17 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 | ** |
@@ -607,6 +607,10 @@ LUALIB_API int luaopen_loadlib (lua_State *L) { | |||
607 | lua_setfield(L, -2, "loaders"); /* put it in field `loaders' */ | 607 | lua_setfield(L, -2, "loaders"); /* put it in field `loaders' */ |
608 | setpath(L, "path", LUA_PATH, LUA_PATH_DEFAULT); /* set field `path' */ | 608 | setpath(L, "path", LUA_PATH, LUA_PATH_DEFAULT); /* set field `path' */ |
609 | setpath(L, "cpath", LUA_CPATH, LUA_CPATH_DEFAULT); /* set field `cpath' */ | 609 | setpath(L, "cpath", LUA_CPATH, LUA_CPATH_DEFAULT); /* set field `cpath' */ |
610 | /* store config information */ | ||
611 | lua_pushstring(L, LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" | ||
612 | LUA_EXECDIR "\n" LUA_IGMARK); | ||
613 | lua_setfield(L, -2, "config"); | ||
610 | /* set field `loaded' */ | 614 | /* set field `loaded' */ |
611 | lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); | 615 | lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); |
612 | lua_setfield(L, -2, "loaded"); | 616 | lua_setfield(L, -2, "loaded"); |