annotate toys/dirname.c @ 226:6aac63925eff

Update web pages.
author Rob Landley <rob@landley.net>
date Sat, 05 Jan 2008 18:09:49 -0600
parents 25447caf1b4b
children d4176f3f3835
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
178
0e94f5f14f08 Add comment and very minor tweak.
Rob Landley <rob@landley.net>
parents: 176
diff changeset
1 /* vi: set sw=4 ts=4: */
0e94f5f14f08 Add comment and very minor tweak.
Rob Landley <rob@landley.net>
parents: 176
diff changeset
2 /* dirname.c - print directory portion of path, or "." if none.
0e94f5f14f08 Add comment and very minor tweak.
Rob Landley <rob@landley.net>
parents: 176
diff changeset
3 *
0e94f5f14f08 Add comment and very minor tweak.
Rob Landley <rob@landley.net>
parents: 176
diff changeset
4 * See http://www.opengroup.org/onlinepubs/009695399/utilities/dirname.html
0e94f5f14f08 Add comment and very minor tweak.
Rob Landley <rob@landley.net>
parents: 176
diff changeset
5 */
0e94f5f14f08 Add comment and very minor tweak.
Rob Landley <rob@landley.net>
parents: 176
diff changeset
6
176
07533cabeede Patch from Charlie Shepherd to add basename and dirname. (Fixed up to apply.)
Rob Landley <rob@landley.net>
parents:
diff changeset
7 #include "toys.h"
07533cabeede Patch from Charlie Shepherd to add basename and dirname. (Fixed up to apply.)
Rob Landley <rob@landley.net>
parents:
diff changeset
8 #include <libgen.h>
07533cabeede Patch from Charlie Shepherd to add basename and dirname. (Fixed up to apply.)
Rob Landley <rob@landley.net>
parents:
diff changeset
9
186
25447caf1b4b Change command main() functions to return void, and exit(toys.exitval) from
Rob Landley <rob@landley.net>
parents: 178
diff changeset
10 void dirname_main(void)
176
07533cabeede Patch from Charlie Shepherd to add basename and dirname. (Fixed up to apply.)
Rob Landley <rob@landley.net>
parents:
diff changeset
11 {
178
0e94f5f14f08 Add comment and very minor tweak.
Rob Landley <rob@landley.net>
parents: 176
diff changeset
12 puts(dirname(*toys.optargs));
176
07533cabeede Patch from Charlie Shepherd to add basename and dirname. (Fixed up to apply.)
Rob Landley <rob@landley.net>
parents:
diff changeset
13 }