aboutsummaryrefslogtreecommitdiff
path: root/toys/pwd.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-11-04 17:45:18 -0500
committerRob Landley <rob@landley.net>2006-11-04 17:45:18 -0500
commitf2311a42a0751e7c039981857fcf60b40f36b475 (patch)
treef2e47d4eb3511cb6c64924e542d509751ccc5035 /toys/pwd.c
parent0a04b3ef850cd3d6f06b3c8d0036993adc9ba7b2 (diff)
downloadtoybox-f2311a42a0751e7c039981857fcf60b40f36b475.tar.gz
Add pwd. Consolidate toy list information under toylist.h.
Diffstat (limited to 'toys/pwd.c')
-rw-r--r--toys/pwd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/toys/pwd.c b/toys/pwd.c
new file mode 100644
index 00000000..3ba7ae0d
--- /dev/null
+++ b/toys/pwd.c
@@ -0,0 +1,16 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * pwd.c - Print working directory.
+ */
+
+#include "toys.h"
+
+int pwd_main(void)
+{
+ char *pwd = xgetcwd();
+
+ puts(pwd);
+ if (CFG_TOYS_FREE) free(pwd);
+
+ return 0;
+}