fs: remove unnecessary comments
This commit is contained in:
parent
c8413899e3
commit
6d47426ea6
1 changed files with 6 additions and 6 deletions
12
lfs.c
12
lfs.c
|
@ -94,7 +94,7 @@ fs_basename(lua_State *L)
|
||||||
path = strndup(luaL_checkstring(L, 1), lua_rawlen(L, 1));
|
path = strndup(luaL_checkstring(L, 1), lua_rawlen(L, 1));
|
||||||
ret = basename(path);
|
ret = basename(path);
|
||||||
|
|
||||||
if (ret == NULL) /* failed? */
|
if (ret == NULL)
|
||||||
return lfail(L);
|
return lfail(L);
|
||||||
|
|
||||||
lua_pushstring(L, ret);
|
lua_pushstring(L, ret);
|
||||||
|
@ -192,7 +192,7 @@ fs_dirname(lua_State *L)
|
||||||
path = strndup(luaL_checkstring(L, 1), lua_rawlen(L, 1));
|
path = strndup(luaL_checkstring(L, 1), lua_rawlen(L, 1));
|
||||||
ret = dirname(path);
|
ret = dirname(path);
|
||||||
|
|
||||||
if (ret == NULL) /* failed? */
|
if (ret == NULL)
|
||||||
return lfail(L);
|
return lfail(L);
|
||||||
|
|
||||||
lua_pushstring(L, ret);
|
lua_pushstring(L, ret);
|
||||||
|
@ -289,9 +289,9 @@ fs_exists(lua_State *L)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
path = luaL_checkstring(L, 1);
|
path = luaL_checkstring(L, 1);
|
||||||
ret = access(path, F_OK); /* check if file exists */
|
ret = access(path, F_OK);
|
||||||
|
|
||||||
if (ret == -1) /* failed? */
|
if (ret == -1)
|
||||||
return lfail(L);
|
return lfail(L);
|
||||||
|
|
||||||
lua_pushboolean(L, ret == 0);
|
lua_pushboolean(L, ret == 0);
|
||||||
|
@ -495,9 +495,9 @@ fs_move(lua_State *L)
|
||||||
|
|
||||||
src = luaL_checkstring(L, 1);
|
src = luaL_checkstring(L, 1);
|
||||||
dest = luaL_checkstring(L, 2);
|
dest = luaL_checkstring(L, 2);
|
||||||
ret = rename(src, dest); /* move file */
|
ret = rename(src, dest);
|
||||||
|
|
||||||
if (ret == 0) { /* check for success */
|
if (ret == 0) {
|
||||||
lua_pushboolean(L, 1);
|
lua_pushboolean(L, 1);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue