commit 497da9d1ddb596da888b9b21c5bac429555c417c
Author: FRIGN <[email protected]>
Date: Sat Feb 28 20:05:22 2015 +0100
Audit unlink(1)
One small thing, use argv0 in usage.
Also, add a blank line in link.c which I forgot earlier.
diff --git a/README b/README
index 5edba2e..ffcc382 100644
--- a/README
+++ b/README
@@ -82,7 +82,7 @@ The following tools are implemented ('*' == finished, '#' ==
UTF-8 support,
=* uname yes none
#* unexpand yes none
=* uniq yes none
-=* unlink yes none
+=*| unlink yes none
=* uudecode yes none
=* uuencode yes none
#* wc yes none
diff --git a/link.c b/link.c
index 5ef8e11..6af7544 100644
--- a/link.c
+++ b/link.c
@@ -19,6 +19,7 @@ main(int argc, char *argv[])
if (argc != 2)
usage();
+
if (link(argv[0], argv[1]) < 0)
eprintf("link:");
diff --git a/unlink.c b/unlink.c
index 077959c..797d18a 100644
--- a/unlink.c
+++ b/unlink.c
@@ -6,7 +6,7 @@
static void
usage(void)
{
- eprintf("usage: unlink file\n");
+ eprintf("usage: %s file\n", argv0);
}
int