annotate toys/pwd.c @ 90:7c77c6ec17ee

Add "make defconfig". Modify global options to start with CONFIG_TOYBOX_.
author Rob Landley <rob@landley.net>
date Wed, 31 Jan 2007 14:37:01 -0500
parents fb56ba93afa3
children 25447caf1b4b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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);
90
7c77c6ec17ee Add "make defconfig". Modify global options to start with CONFIG_TOYBOX_.
Rob Landley <rob@landley.net>
parents: 73
diff changeset
13 if (CFG_TOYBOX_FREE) free(pwd);
21
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 }