]> code.delx.au - gnu-emacs/commitdiff
Fix error in Tramp perl script for cygwin
authorMichael Albinus <michael.albinus@gmx.de>
Wed, 9 Dec 2015 11:17:15 +0000 (12:17 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Wed, 9 Dec 2015 11:17:15 +0000 (12:17 +0100)
* lisp/net/tramp-sh.el (tramp-perl-file-truename): Do not raise an
error if file doesn't exist.

lisp/net/tramp-sh.el

index c1df1c602d5caacb18ee142f50fc3d7cd038d4e1..03492de11499bfa7e893fe83ca7b8ec4fcc57106 100644 (file)
@@ -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));