diff options
-rw-r--r-- | src/lfs.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -458,18 +458,8 @@ static int make_dir (lua_State *L) { | |||
458 | ** @param #1 Directory path. | 458 | ** @param #1 Directory path. |
459 | */ | 459 | */ |
460 | static int remove_dir (lua_State *L) { | 460 | static 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 | ||