Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keplerproject/luafilesystem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-05-04 13:40:30 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-05-04 13:40:30 +0300
commit37895218387123444d84f94cb5f9a28c09ff47a0 (patch)
tree9be55d5d95bc189851b991b78c27cd8dc54b2df1 /src
parent5220452e3b5898be05f5d4e8c8cfbb46f06ede96 (diff)
Refactor set_info() using lua_setfield
About indentation: currently parts of lfs.c use 2 spaces and parts use 8. It would be nice to slowly switch to one of styles over some time, as code is being touched here and there. 2 spaces seem preferrable as it's what Lua itself uses.
Diffstat (limited to 'src')
-rw-r--r--src/lfs.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/lfs.c b/src/lfs.c
index 96d6f9e..d6b55df 100644
--- a/src/lfs.c
+++ b/src/lfs.c
@@ -861,15 +861,12 @@ static int link_info (lua_State *L) {
** Assumes the table is on top of the stack.
*/
static void set_info (lua_State *L) {
- lua_pushliteral (L, "_COPYRIGHT");
- lua_pushliteral (L, "Copyright (C) 2003-2012 Kepler Project");
- lua_settable (L, -3);
- lua_pushliteral (L, "_DESCRIPTION");
- lua_pushliteral (L, "LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution");
- lua_settable (L, -3);
- lua_pushliteral (L, "_VERSION");
- lua_pushliteral (L, "LuaFileSystem " LFS_VERSION);
- lua_settable (L, -3);
+ lua_pushliteral(L, "Copyright (C) 2003-2016 Kepler Project");
+ lua_setfield(L, -2, "_COPYRIGHT");
+ lua_pushliteral(L, "LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution");
+ lua_setfield(L, -2, "_DESCRIPTION");
+ lua_pushliteral(L, "LuaFileSystem " LFS_VERSION);
+ lua_setfield(L, -2, "_VERSION");
}