Mercurial > hg > toybox
comparison toys/dirname.c @ 178:0e94f5f14f08
Add comment and very minor tweak.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 27 Nov 2007 01:19:40 -0600 |
parents | 07533cabeede |
children | 25447caf1b4b |
comparison
equal
deleted
inserted
replaced
177:00bbb7f65b6f | 178:0e94f5f14f08 |
---|---|
1 /* vi: set sw=4 ts=4: */ | |
2 /* dirname.c - print directory portion of path, or "." if none. | |
3 * | |
4 * See http://www.opengroup.org/onlinepubs/009695399/utilities/dirname.html | |
5 */ | |
6 | |
1 #include "toys.h" | 7 #include "toys.h" |
2 #include <libgen.h> | 8 #include <libgen.h> |
3 | 9 |
4 int dirname_main(void) | 10 int dirname_main(void) |
5 { | 11 { |
6 puts(dirname(toys.optargs[0])); | 12 puts(dirname(*toys.optargs)); |
7 return 0; | 13 return 0; |
8 } | 14 } |