diff options
author | Rob Landley <rob@landley.net> | 2007-11-27 00:57:42 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2007-11-27 00:57:42 -0600 |
commit | c15b3edf55ebd915b234e2ee6280a19874a052f9 (patch) | |
tree | 43d6c9c5bce6f6b7200ebb0aa84479248d1596b5 /toys/dirname.c | |
parent | 57389ec1d8f5b32e5de97f0f557e5f5c5b7054bb (diff) | |
download | toybox-c15b3edf55ebd915b234e2ee6280a19874a052f9.tar.gz |
Patch from Charlie Shepherd to add basename and dirname. (Fixed up to apply.)
Diffstat (limited to 'toys/dirname.c')
-rw-r--r-- | toys/dirname.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/toys/dirname.c b/toys/dirname.c new file mode 100644 index 00000000..454a5d67 --- /dev/null +++ b/toys/dirname.c @@ -0,0 +1,8 @@ +#include "toys.h" +#include <libgen.h> + +int dirname_main(void) +{ + puts(dirname(toys.optargs[0])); + return 0; +} |