aboutsummaryrefslogtreecommitdiff
path: root/toys/pwd.c
diff options
context:
space:
mode:
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;
+}