Mercurial > hg > toybox
annotate toys/pwd.c @ 73:fb56ba93afa3
Teach pwd to detect write errors.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 20 Jan 2007 22:59:00 -0500 |
parents | 6475d6c46066 |
children | 7c77c6ec17ee |
rev | line source |
---|---|
21
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 /* vi: set sw=4 ts=4: */ |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 /* |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 * pwd.c - Print working directory. |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 */ |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 #include "toys.h" |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 int pwd_main(void) |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 { |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 char *pwd = xgetcwd(); |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
11 |
73
fb56ba93afa3
Teach pwd to detect write errors.
Rob Landley <rob@landley.net>
parents:
21
diff
changeset
|
12 xprintf("%s\n", pwd); |
21
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 if (CFG_TOYS_FREE) free(pwd); |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
14 |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
15 return 0; |
6475d6c46066
Add pwd. Consolidate toy list information under toylist.h.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
16 } |