aboutsummaryrefslogtreecommitdiff
path: root/coreutils/dirname.c
diff options
context:
space:
mode:
authormjn3 <mjn3@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-03-19 09:13:01 +0000
committermjn3 <mjn3@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-03-19 09:13:01 +0000
commite901c15d890dbbdce4c086963cb1513653fc46b5 (patch)
treea318d0f03aa076c74b576ea45dc543a5669e8e91 /coreutils/dirname.c
parent40758c00616c3b2c85d83eb4afdeb04b1f65c9f1 (diff)
downloadbusybox-w32-e901c15d890dbbdce4c086963cb1513653fc46b5.tar.gz
busybox-w32-e901c15d890dbbdce4c086963cb1513653fc46b5.tar.bz2
busybox-w32-e901c15d890dbbdce4c086963cb1513653fc46b5.zip
Major coreutils update.
git-svn-id: svn://busybox.net/trunk/busybox@6751 69ca8d6d-28ef-0310-b511-8ec308f3f277
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}