Commit 36969de6 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

<making srcdir absolute>: Unset CDPATH in case $PWD

contains a relative path.  Protect against unusable values of
$PWD.
parent aa5b8e15
...@@ -99,17 +99,17 @@ AC_ARG_WITH(xim, ...@@ -99,17 +99,17 @@ AC_ARG_WITH(xim,
[ --without-xim don't use X11 XIM]) [ --without-xim don't use X11 XIM])
#### Make srcdir absolute, if it isn't already. It's important to #### Make srcdir absolute, if it isn't already. It's important to
#### avoid running the path through pwd unnecessary, since pwd can #### avoid running the path through pwd unnecessarily, since pwd can
#### give you automounter prefixes, which can go away. We do all this #### give you automounter prefixes, which can go away. We do all this
#### so Emacs can find its files when run uninstalled. #### so Emacs can find its files when run uninstalled.
## Make sure CDPATH doesn't affect cd (in case PWD is relative).
unset CDPATH
case "${srcdir}" in case "${srcdir}" in
/* ) ;; /* ) ;;
. ) . )
## We may be able to use the $PWD environment variable to make this ## We may be able to use the $PWD environment variable to make this
## absolute. But sometimes PWD is inaccurate. ## absolute. But sometimes PWD is inaccurate.
## Make sure CDPATH doesn't affect cd (in case PWD is relative). if test ".${PWD}" != "." && test ".`(cd ${PWD} ; sh -c pwd)`" = ".${PWD}" ;
unset CDPATH
if test "${PWD}" != "" && test "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`" ;
then then
srcdir="$PWD" srcdir="$PWD"
else else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment