aboutsummaryrefslogtreecommitdiff
path: root/coreutils/dirname.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/dirname.c')
-rw-r--r--coreutils/dirname.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/coreutils/dirname.c b/coreutils/dirname.c
index 387233789..4c6115e66 100644
--- a/coreutils/dirname.c
+++ b/coreutils/dirname.c
@@ -21,20 +21,20 @@
21 * 21 *
22 */ 22 */
23 23
24/* getopt not needed */ 24/* BB_AUDIT SUSv3 compliant */
25/* http://www.opengroup.org/onlinepubs/007904975/utilities/dirname.html */
25 26
26#include <stdio.h> 27#include <stdio.h>
27#include <stdlib.h> 28#include <stdlib.h>
28#include <string.h>
29#include "busybox.h" 29#include "busybox.h"
30 30
31extern int dirname_main(int argc, char **argv) 31extern int dirname_main(int argc, char **argv)
32{ 32{
33 if ((argc < 2) || (**(argv + 1) == '-')) 33 if (argc != 2) {
34 show_usage(); 34 bb_show_usage();
35 argv++; 35 }
36 36
37 puts (dirname (argv[0])); 37 puts(dirname(argv[1]));
38 38
39 return EXIT_SUCCESS; 39 bb_fflush_stdout_and_exit(EXIT_SUCCESS);
40} 40}