From a90ba8d0156c6e808f481611083b65f2dbf4dc50 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 8 Sep 2023 11:07:54 +0200 Subject: [PATCH] Fix Perl script in Tramp * lisp/net/tramp-sh.el (tramp-perl-file-name-all-completions): Fix Perl script. (Bug#65744) --- lisp/net/tramp-sh.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c00234d43da..05cd27780cb 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -634,7 +634,10 @@ characters need to be doubled.") (defconst tramp-perl-file-name-all-completions "%p -e ' -($dir = $ARGV[0]) =~ s#/+$##; +$dir = $ARGV[0]; +if ($dir ne \"/\") { + $dir =~ s#/+$##; +} opendir(d, $dir) || die(\"$dir: $!\\nfail\\n\"); @files = readdir(d); closedir(d); print \"(\\n\"; -- 2.39.5