summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-04-25 14:22:38 +0000
committerru <ru@FreeBSD.org>2001-04-25 14:22:38 +0000
commiteaf5ab661c732af63832ac313914235e6ba76fe7 (patch)
tree43cc6fc49b490712ed74ea2f1ec6309e7d16f1ad /usr.bin/make
parent06672ba7f1883644b43b18ab79d0b25502c707ad (diff)
downloadFreeBSD-src-eaf5ab661c732af63832ac313914235e6ba76fe7.zip
FreeBSD-src-eaf5ab661c732af63832ac313914235e6ba76fe7.tar.gz
Make ${.OBJDIR} canonical.
Reviewed by: bde
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/main.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index dc8c8c8..4ba3a6a 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -418,19 +418,11 @@ chdir_verify_path(path, obpath)
struct stat sb;
if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) {
- if (chdir(path)) {
+ if (chdir(path) == -1 || getcwd(obpath, MAXPATHLEN) == NULL) {
warn("warning: %s", path);
return 0;
}
- else {
- if (path[0] != '/') {
- (void) snprintf(obpath, MAXPATHLEN, "%s/%s",
- curdir, path);
- return obpath;
- }
- else
- return path;
- }
+ return obpath;
}
return 0;
OpenPOWER on IntegriCloud