Make ${.OBJDIR} canonical.

Reviewed by:	bde
This commit is contained in:
Ruslan Ermilov 2001-04-25 14:22:38 +00:00
parent 7b6630700d
commit 43403d166a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75973

View File

@ -418,20 +418,12 @@ 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 0;
}