commit 87c139e37733822176db7269587c4f57b22b75d1 parent 240166293a43bfd351c86be5cee614fe52d56761 Author: call-cc <callcc@vxempire.xyz> Date: Fri, 19 Jun 2020 11:08:07 -0400 Fix ln slightly by removing instead of unlinking. Diffstat:
M | src/ln.c | | | 6 | ++++-- |
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/ln.c b/src/ln.c @@ -18,8 +18,10 @@ main(int argc, char *argv[]) case 'f': fflag=1; case 's': - if(fflag && (access(argv[3], F_OK) != 1)) - unlink(argv[3]); + if(fflag && (access(argv[3], F_OK) != 1)) { + if(remove(argv[3]) == -1) + rmdir(argv[3]); + } int symstat = symlink(argv[2],argv[3]); if(symstat == -1) {