summaryrefslogtreecommitdiff
path: root/bin/realpath
diff options
context:
space:
mode:
authorJohan Karlsson <johan@FreeBSD.org>2002-12-18 10:20:40 +0000
committerJohan Karlsson <johan@FreeBSD.org>2002-12-18 10:20:40 +0000
commit9a26e46eb49463ac5c18ddd8371b4b2b6a6d689b (patch)
tree1f91e920284acd6b620e70cad3a2cc39566c9692 /bin/realpath
parent0c21294cee5529f60ea6be348faaffda9a13badd (diff)
downloadsrc-test2-9a26e46eb49463ac5c18ddd8371b4b2b6a6d689b.tar.gz
src-test2-9a26e46eb49463ac5c18ddd8371b4b2b6a6d689b.zip
- use MAXPATHLEN per realpath(3)
- use the problematic part of the path, instead of the argument, when reporting an error. Reviewed by: mike
Notes
Notes: svn path=/head/; revision=108032
Diffstat (limited to 'bin/realpath')
-rw-r--r--bin/realpath/realpath.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/realpath/realpath.c b/bin/realpath/realpath.c
index 57cbb971cc43..c526733e9000 100644
--- a/bin/realpath/realpath.c
+++ b/bin/realpath/realpath.c
@@ -46,7 +46,7 @@ static void usage(void) __dead2;
int
main(int argc, char *argv[])
{
- char buf[PATH_MAX];
+ char buf[MAXPATHLEN];
char *p;
if (argc == 1) {
@@ -54,7 +54,7 @@ main(int argc, char *argv[])
err(1, "getcwd()");
} else if (argc == 2) {
if ((p = realpath(argv[1], buf)) == NULL)
- err(1, "%s", argv[1]);
+ err(1, "%s", buf);
} else
usage();
(void)printf("%s\n", p);