File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 44 * \author Copyright (c) 2002-2013 Jess Perkins and the Premake project
55 */
66
7+ #include <sys/stat.h>
78#include <stdlib.h>
89#include "premake.h"
910
@@ -23,7 +24,12 @@ int os_rmdir(lua_State* L)
2324
2425 z = RemoveDirectoryW (wide_path );
2526#else
26- z = (0 == rmdir (path ));
27+ struct stat buf ;
28+ if (lstat (path , & buf ) == 0 && S_ISLNK (buf .st_mode )) {
29+ z = (0 == unlink (path ));
30+ } else {
31+ z = (0 == rmdir (path ));
32+ }
2733#endif
2834
2935 if (!z )
Original file line number Diff line number Diff line change 7070 test .istrue (os .linkdir (" folder/subfolder" , " folder/subfolder2" ))
7171 test .istrue (os .islink (" folder/subfolder2" ))
7272 os .rmdir (" folder/subfolder2" )
73+ test .isfalse (os .islink (" folder/subfolder2" ))
7374 end
7475
7576 function suite .linkfile ()
7677 test .istrue (os .linkfile (" folder/ok.lua" , " folder/ok2.lua" ))
7778 test .istrue (os .islink (" folder/ok2.lua" ))
7879 os.remove (" folder/ok2.lua" )
80+ test .isfalse (os .islink (" folder/ok2.lua" ))
7981 end
8082
8183
You can’t perform that action at this time.
0 commit comments