10 |
/* BB_AUDIT SUSv3 compliant */ |
/* BB_AUDIT SUSv3 compliant */ |
11 |
/* http://www.opengroup.org/onlinepubs/007904975/utilities/dirname.html */ |
/* http://www.opengroup.org/onlinepubs/007904975/utilities/dirname.html */ |
12 |
|
|
13 |
#include <stdio.h> |
#include "libbb.h" |
|
#include <stdlib.h> |
|
|
#include "busybox.h" |
|
14 |
|
|
15 |
|
/* This is a NOFORK applet. Be very careful! */ |
16 |
|
|
17 |
|
int dirname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
18 |
int dirname_main(int argc, char **argv) |
int dirname_main(int argc, char **argv) |
19 |
{ |
{ |
20 |
if (argc != 2) { |
if (argc != 2) { |
23 |
|
|
24 |
puts(dirname(argv[1])); |
puts(dirname(argv[1])); |
25 |
|
|
26 |
fflush_stdout_and_exit(EXIT_SUCCESS); |
return fflush(stdout); |
27 |
} |
} |