blob: bd36d627ef65ba363a37a101e0fc798a286719c7 [file] [log] [blame]
Erik Andersene49d5ec2000-02-08 19:58:47 +00001/* vi: set sw=4 ts=4: */
Eric Andersenc4996011999-10-20 22:08:37 +00002/*
3 * Mini pwd implementation for busybox
4 *
Eric Andersenc4996011999-10-20 22:08:37 +00005 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>.
6 *
"Robert P. J. Day"801ab142006-07-12 07:56:04 +00007 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
Eric Andersenc4996011999-10-20 22:08:37 +00008 */
9
Eric Andersencc8ed391999-10-05 16:24:54 +000010#include <stdio.h>
Eric Andersened3ef502001-01-27 08:24:39 +000011#include <stdlib.h>
Eric Andersencbe31da2001-02-20 06:14:08 +000012#include "busybox.h"
Eric Andersencc8ed391999-10-05 16:24:54 +000013
Rob Landleydfba7412006-03-06 20:47:33 +000014int pwd_main(int argc, char **argv)
Eric Andersencc8ed391999-10-05 16:24:54 +000015{
Manuel Novoa III cad53642003-03-19 09:13:01 +000016 char *buf;
17
18 if ((buf = xgetcwd(NULL)) != NULL) {
Eric Andersene5dfced2001-04-09 22:48:12 +000019 puts(buf);
Denis Vlasenkof0ed3762006-10-26 23:21:47 +000020 fflush_stdout_and_exit(EXIT_SUCCESS);
Eric Andersene5dfced2001-04-09 22:48:12 +000021 }
Manuel Novoa III cad53642003-03-19 09:13:01 +000022
Eric Andersene5dfced2001-04-09 22:48:12 +000023 return EXIT_FAILURE;
Eric Andersencc8ed391999-10-05 16:24:54 +000024}