diff options
| author | Peter Melnichenko <mpeterval@gmail.com> | 2016-05-04 13:40:30 +0300 |
|---|---|---|
| committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-05-04 13:40:30 +0300 |
| commit | 37895218387123444d84f94cb5f9a28c09ff47a0 (patch) | |
| tree | 9be55d5d95bc189851b991b78c27cd8dc54b2df1 /src | |
| parent | 5220452e3b5898be05f5d4e8c8cfbb46f06ede96 (diff) | |
| download | luafilesystem-37895218387123444d84f94cb5f9a28c09ff47a0.tar.gz luafilesystem-37895218387123444d84f94cb5f9a28c09ff47a0.tar.bz2 luafilesystem-37895218387123444d84f94cb5f9a28c09ff47a0.zip | |
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.c | 15 |
1 files changed, 6 insertions, 9 deletions
| @@ -861,15 +861,12 @@ static int link_info (lua_State *L) { | |||
| 861 | ** Assumes the table is on top of the stack. | 861 | ** Assumes the table is on top of the stack. |
| 862 | */ | 862 | */ |
| 863 | static void set_info (lua_State *L) { | 863 | static void set_info (lua_State *L) { |
| 864 | lua_pushliteral (L, "_COPYRIGHT"); | 864 | lua_pushliteral(L, "Copyright (C) 2003-2016 Kepler Project"); |
| 865 | lua_pushliteral (L, "Copyright (C) 2003-2012 Kepler Project"); | 865 | lua_setfield(L, -2, "_COPYRIGHT"); |
| 866 | lua_settable (L, -3); | 866 | 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"); |
| 867 | lua_pushliteral (L, "_DESCRIPTION"); | 867 | lua_setfield(L, -2, "_DESCRIPTION"); |
| 868 | 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"); | 868 | lua_pushliteral(L, "LuaFileSystem " LFS_VERSION); |
| 869 | lua_settable (L, -3); | 869 | lua_setfield(L, -2, "_VERSION"); |
| 870 | lua_pushliteral (L, "_VERSION"); | ||
| 871 | lua_pushliteral (L, "LuaFileSystem " LFS_VERSION); | ||
| 872 | lua_settable (L, -3); | ||
| 873 | } | 870 | } |
| 874 | 871 | ||
| 875 | 872 | ||
