This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
avoid infinite recursion in _perl_abs_path()
authorZefram <zefram@fysh.org>
Tue, 26 Dec 2017 07:46:35 +0000 (07:46 +0000)
committerZefram <zefram@fysh.org>
Tue, 26 Dec 2017 07:46:35 +0000 (07:46 +0000)
commit815d526fdd295b59d805cd4c2871b7a3604247b1
tree27eeb4848a287ca491d67cb7771943a520efa876
parentdc3c11c5b3d54ab8fc396c19fa05e08481207107
avoid infinite recursion in _perl_abs_path()

If _perl_abs_path() couldn't opendir("..") then it would call
File::Spec->rel2abs, which was liable to call back to Cwd::getcwd() and
thus to _perl_abs_path(), producing an infinite recursion.  The call to
File::Spec->rel2abs is of dubious value anyway, so just turn that into
an error return.  Fixes [perl #132651].
dist/PathTools/Cwd.pm
dist/PathTools/t/cwd_enoent.t