From e9400873cc9f09164796a62c17bc188d04eeaa01 Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 11 Feb 2002 18:38:54 +0000 Subject: o Remove old code from pwd(1); realpath(1) is now in its own directory. o Fix some unordered includes in pwd(1). o Connect realpath(1) to the build. --- bin/pwd/Makefile | 2 -- bin/pwd/pwd.c | 20 +++----------------- 2 files changed, 3 insertions(+), 19 deletions(-) (limited to 'bin/pwd') diff --git a/bin/pwd/Makefile b/bin/pwd/Makefile index 129ed63..4a8e66a 100644 --- a/bin/pwd/Makefile +++ b/bin/pwd/Makefile @@ -2,7 +2,5 @@ # $FreeBSD$ PROG= pwd -LINKS= ${BINDIR}/pwd ${BINDIR}/realpath -MAN= pwd.1 realpath.1 .include diff --git a/bin/pwd/pwd.c b/bin/pwd/pwd.c index 6302c28..db5f2f3 100644 --- a/bin/pwd/pwd.c +++ b/bin/pwd/pwd.c @@ -45,16 +45,15 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ -#include +#include #include +#include #include #include -#include #include #include #include -#include static char *getcwd_logical(void); void usage(void); @@ -65,16 +64,6 @@ main(int argc, char *argv[]) int Lflag, Pflag; int ch; char *p; - char buf[PATH_MAX]; - - if (strcmp(getprogname(), "realpath") == 0) { - if (argc != 2) - usage(); - if ((p = realpath(argv[1], buf)) == NULL) - err(1, "%s", argv[1]); - (void)printf("%s\n", p); - exit(0); - } Lflag = Pflag = 0; while ((ch = getopt(argc, argv, "LP")) != -1) @@ -107,10 +96,7 @@ void usage(void) { - if (strcmp(getprogname(), "realpath") == 0) - (void)fprintf(stderr, "usage: realpath [path]\n"); - else - (void)fprintf(stderr, "usage: pwd [-L | -P]\n"); + (void)fprintf(stderr, "usage: pwd [-L | -P]\n"); exit(1); } -- cgit v1.1