diff options
Diffstat (limited to 'coreutils/dirname.c')
-rw-r--r-- | coreutils/dirname.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/coreutils/dirname.c b/coreutils/dirname.c index 3872337..4c6115e 100644 --- a/coreutils/dirname.c +++ b/coreutils/dirname.c @@ -21,20 +21,20 @@ * */ -/* getopt not needed */ +/* BB_AUDIT SUSv3 compliant */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/dirname.html */ #include <stdio.h> #include <stdlib.h> -#include <string.h> #include "busybox.h" extern int dirname_main(int argc, char **argv) { - if ((argc < 2) || (**(argv + 1) == '-')) - show_usage(); - argv++; + if (argc != 2) { + bb_show_usage(); + } - puts (dirname (argv[0])); + puts(dirname(argv[1])); - return EXIT_SUCCESS; + bb_fflush_stdout_and_exit(EXIT_SUCCESS); } |