diff options
-rw-r--r-- | src/lfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -63,6 +63,7 @@ | |||
63 | #include "lfs.h" | 63 | #include "lfs.h" |
64 | 64 | ||
65 | #define LFS_VERSION "1.6.2" | 65 | #define LFS_VERSION "1.6.2" |
66 | #define LFS_LIBNAME "lfs" | ||
66 | 67 | ||
67 | #if LUA_VERSION_NUM < 502 | 68 | #if LUA_VERSION_NUM < 502 |
68 | # define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l)) | 69 | # define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l)) |
@@ -878,6 +879,8 @@ int luaopen_lfs (lua_State *L) { | |||
878 | dir_create_meta (L); | 879 | dir_create_meta (L); |
879 | lock_create_meta (L); | 880 | lock_create_meta (L); |
880 | luaL_newlib (L, fslib); | 881 | luaL_newlib (L, fslib); |
882 | lua_pushvalue(L, -1); | ||
883 | lua_setglobal(L, LFS_LIBNAME); | ||
881 | set_info (L); | 884 | set_info (L); |
882 | return 1; | 885 | return 1; |
883 | } | 886 | } |