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.
This commit is contained in:
parent
19f56da943
commit
0dd10cae52
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90535
@ -23,6 +23,7 @@ SUBDIR= cat \
|
|||||||
ps \
|
ps \
|
||||||
pwd \
|
pwd \
|
||||||
rcp \
|
rcp \
|
||||||
|
realpath \
|
||||||
rm \
|
rm \
|
||||||
rmdir \
|
rmdir \
|
||||||
setfacl \
|
setfacl \
|
||||||
|
@ -2,7 +2,5 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
PROG= pwd
|
PROG= pwd
|
||||||
LINKS= ${BINDIR}/pwd ${BINDIR}/realpath
|
|
||||||
MAN= pwd.1 realpath.1
|
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
|
@ -45,16 +45,15 @@ static const char rcsid[] =
|
|||||||
"$FreeBSD$";
|
"$FreeBSD$";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/param.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/param.h>
|
|
||||||
|
|
||||||
static char *getcwd_logical(void);
|
static char *getcwd_logical(void);
|
||||||
void usage(void);
|
void usage(void);
|
||||||
@ -65,16 +64,6 @@ main(int argc, char *argv[])
|
|||||||
int Lflag, Pflag;
|
int Lflag, Pflag;
|
||||||
int ch;
|
int ch;
|
||||||
char *p;
|
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;
|
Lflag = Pflag = 0;
|
||||||
while ((ch = getopt(argc, argv, "LP")) != -1)
|
while ((ch = getopt(argc, argv, "LP")) != -1)
|
||||||
@ -107,10 +96,7 @@ void
|
|||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (strcmp(getprogname(), "realpath") == 0)
|
(void)fprintf(stderr, "usage: pwd [-L | -P]\n");
|
||||||
(void)fprintf(stderr, "usage: realpath [path]\n");
|
|
||||||
else
|
|
||||||
(void)fprintf(stderr, "usage: pwd [-L | -P]\n");
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user