Use env pwd instead of pwd in crunchgen.c
In r364166 I changed /bin/pwd to pwd, but pwd can be shell builtin that may not correctly return a real path. To ensure that all symlinks are resolved use `env pwd -P` instead (the -P flag is part of POSIX so should be supported everywhere). Reported By: rgrimes Suggested By: jrtc27
This commit is contained in:
parent
f7d79f6c6d
commit
d5c62a6f03
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=364174
@ -653,7 +653,7 @@ fillin_program(prog_t *p)
|
|||||||
|
|
||||||
/* Determine the actual srcdir (maybe symlinked). */
|
/* Determine the actual srcdir (maybe symlinked). */
|
||||||
if (p->srcdir) {
|
if (p->srcdir) {
|
||||||
snprintf(line, MAXLINELEN, "cd %s && pwd", p->srcdir);
|
snprintf(line, MAXLINELEN, "cd %s && env pwd -P", p->srcdir);
|
||||||
f = popen(line,"r");
|
f = popen(line,"r");
|
||||||
if (!f)
|
if (!f)
|
||||||
errx(1, "Can't execute: %s\n", line);
|
errx(1, "Can't execute: %s\n", line);
|
||||||
|
Loading…
Reference in New Issue
Block a user