-# abs_path resolves symlinks, so we want to avoid it if rel2abs
-# is sufficient and doesn't leave "/.." or "/../"
-sub rel2abs_collapsed ($) {
- my $p = File::Spec->rel2abs($_[0]);
- return $p if substr($p, -3, 3) ne '/..' && index($p, '/../') < 0; # likely
- require Cwd;
- Cwd::abs_path($p);
-}
-