k9core

Unnamed repository
Log | Files | Refs | LICENSE

commit 3843efd08f765ff51539e65b1c6cca84c05c2b93
parent 0575e4de01c907b372011c5eac705132d3aefffe
Author: qorg11 <qorg@vxempire.xyz>
Date:   Tue,  2 Jun 2020 21:46:28 +0200

Tried to add symlinks the worst way possible. Please fix

Diffstat:
Msrc/ln.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/ln.c b/src/ln.c @@ -6,11 +6,21 @@ int main(int argc, char *argv[]) { + if(argc == 1) { printf("Usage: ln oldfile newfile\n"); return 1; } + + int c = getopt(argc, argv, "s"); + if(c == 's') + { + symlink(argv[2],argv[3]); + return 0; + } + + int fd = link(argv[1],argv[2]); if(fd == -1) {