]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Tramp scripts
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 23 Jun 2025 16:00:08 +0000 (18:00 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 23 Jul 2025 19:01:58 +0000 (21:01 +0200)
* 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

index 1be2c1628eeff5724884b7d6ca729fbcb60c7ee6..d9bfd522c6c76b566031322a9af100d6e9f04120 100644 (file)
@@ -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.