[hackers] [sbase] Audit dirname(1) || FRIGN
commit 2b8698f01ad049b4eb459e46b72c5c0ce0ccac39
Author: FRIGN <dev_AT_frign.de>
Date: Sat Feb 28 19:50:12 2015 +0100
Audit dirname(1)
Be stricter about the number of arguments passed to it.
diff --git a/README b/README
index 4e14de8..9833019 100644
--- a/README
+++ b/README
_AT_@ -24,7 +24,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
=* cron non-posix none
#* cut yes none
=* date yes -u
-=* dirname yes none
+=*| dirname yes none
=* du yes none
=* echo yes none
=* env yes none
diff --git a/dirname.1 b/dirname.1
index 6258ae1..d45efcf 100644
--- a/dirname.1
+++ b/dirname.1
_AT_@ -1,4 +1,4 @@
-.Dd January 23, 2015
+.Dd February 28, 2015
.Dt DIRNAME 1
.Os sbase
.Sh NAME
_AT_@ -9,9 +9,9 @@
.Ar path
.Sh DESCRIPTION
.Nm
-prints
+writes
.Ar path
-with its final path component removed.
+with its final path component removed to stdout.
.Sh SEE ALSO
.Xr basename 1 ,
.Xr dirname 3
diff --git a/dirname.c b/dirname.c
index b055deb..501e5a0 100644
--- a/dirname.c
+++ b/dirname.c
_AT_@ -18,7 +18,7 @@ main(int argc, char *argv[])
usage();
} ARGEND;
- if (argc < 1)
+ if (argc != 1)
usage();
puts(dirname(argv[0]));
Received on Sat Feb 28 2015 - 20:40:39 CET
This archive was generated by hypermail 2.3.0
: Sat Feb 28 2015 - 20:48:09 CET