diff --git a/src/dirname.c b/src/dirname.c new file mode 100644 index 0000000..2e4a26b --- /dev/null +++ b/src/dirname.c @@ -0,0 +1,13 @@ +#include +#include + +int +main(int argc, char *argv[]) { + char *dir; + if((dir = dirname(argv[1])) == NULL) { + fprintf(stderr, "%s", argv[0]); + return 1; + } + puts(dir); + return 0; +}