From 0e3e089e1f23ed9e4eb50f9095ba743df2d6e6cb Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 23 Jun 2025 18:00:08 +0200 Subject: [PATCH] Fix Tramp scripts * lisp/net/tramp-sh.el (tramp-shell-file-name-all-completions) (tramp-bundle-read-file-names): Fix scripts. (cherry picked from commit 991d3ad80a37a1cf8951d2607eb5f7544f968e93) --- lisp/net/tramp-sh.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 1be2c1628ee..d9bfd522c6c 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -748,8 +748,8 @@ doubled.") (defconst tramp-shell-file-name-all-completions "cd \"$1\" 2>&1; %l -a %n | while IFS= read file; do - quoted=`echo \"$1/$file\" | sed -e \"s#//#/#g\" -e \"s/\\\"/\\\\\\\\\\\\\\\\\\\"/g\"` - printf \"%%b\n\" \"$quoted\" + quoted=`echo \"$1/$file\" | sed -e \"s#//#/#g\"` + printf \"%%s\\n\" \"$quoted\" done | tramp_bundle_read_file_names" "Shell script to produce output suitable for use with `file-name-all-completions' on the remote file system. It returns the @@ -1187,11 +1187,11 @@ characters need to be doubled.") "echo \"(\" while IFS= read file; do quoted=`echo \"$file\" | sed -e \"s/\\\"/\\\\\\\\\\\\\\\\\\\"/g\"` - printf \"(%%b\" \"\\\"$quoted\\\"\" - if %q \"$file\"; then printf \" %%b\" t; else printf \" %%b\" nil; fi - if %m -r \"$file\"; then printf \" %%b\" t; else printf \" %%b\" nil; fi - if %m -d \"$file\"; then printf \" %%b\" t; else printf \" %%b\" nil; fi - if %m -x \"$file\"; then printf \" %%b)\n\" t; else printf \" %%b)\n\" nil; fi + printf \"(%%s\" \"\\\"$quoted\\\"\" + if %q \"$file\"; then printf \" %%s\" t; else printf \" %%s\" nil; fi + if %m -r \"$file\"; then printf \" %%s\" t; else printf \" %%s\" nil; fi + if %m -d \"$file\"; then printf \" %%s\" t; else printf \" %%s\" nil; fi + if %m -x \"$file\"; then printf \" %%s)\\n\" t; else printf \" %%s)\\n\" nil; fi done echo \")\"" "Shell script to check file attributes of a bundle of files. -- 2.39.5