From b227422c66f20806f406730f8ef7dea276956151 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 9 Dec 2015 12:17:15 +0100 Subject: [PATCH] Fix error in Tramp perl script for cygwin * lisp/net/tramp-sh.el (tramp-perl-file-truename): Do not raise an error if file doesn't exist. --- lisp/net/tramp-sh.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c1df1c602d5..03492de1149 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -597,9 +597,14 @@ we have this shell function.") use File::Spec; use Cwd \"realpath\"; +sub myrealpath { + my ($file) = @_; + return realpath($file) if -e $file; +} + sub recursive { my ($volume, @dirs) = @_; - my $real = realpath(File::Spec->catpath( + my $real = myrealpath(File::Spec->catpath( $volume, File::Spec->catdir(@dirs), \"\")); if ($real) { my ($vol, $dir) = File::Spec->splitpath($real, 1); @@ -613,7 +618,7 @@ sub recursive { } } -$result = realpath($ARGV[0]); +$result = myrealpath($ARGV[0]); if (!$result) { my ($vol, $dir) = File::Spec->splitpath($ARGV[0], 1); ($vol, @dirs) = recursive($vol, File::Spec->splitdir($dir)); -- 2.39.2