aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lfs.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/lfs.c b/src/lfs.c
index 25535ce..2ead179 100644
--- a/src/lfs.c
+++ b/src/lfs.c
@@ -458,18 +458,8 @@ static int make_dir (lua_State *L) {
458** @param #1 Directory path. 458** @param #1 Directory path.
459*/ 459*/
460static int remove_dir (lua_State *L) { 460static int remove_dir (lua_State *L) {
461 const char *path = luaL_checkstring (L, 1); 461 const char *path = luaL_checkstring(L, 1);
462 int fail; 462 return pushresult(L, rmdir(path), NULL);
463
464 fail = rmdir (path);
465
466 if (fail) {
467 lua_pushnil (L);
468 lua_pushfstring (L, "%s", strerror(errno));
469 return 2;
470 }
471 lua_pushboolean (L, 1);
472 return 1;
473} 463}
474 464
475 465