emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master cea78ad 1/2: Fix Tramp's directory-files-and-attrib


From: Michael Albinus
Subject: [Emacs-diffs] master cea78ad 1/2: Fix Tramp's directory-files-and-attributes-with-stat (Bug#37228)
Date: Fri, 30 Aug 2019 07:54:50 -0400 (EDT)

branch: master
commit cea78adf7c57e82f1343c7a004cd4053d2e312a6
Author: Koichi Arakawa <address@hidden>
Commit: Michael Albinus <address@hidden>

    Fix Tramp's directory-files-and-attributes-with-stat  (Bug#37228)
    
    * lisp/net/tramp-sh.el
    (tramp-do-directory-files-and-attributes-with-stat): Handle file
    names with spaces.  (Bug#37228)
    
    Copyright-paperwork-exempt: yes
---
 lisp/net/tramp-sh.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 217e73a..bcfac78 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1759,11 +1759,14 @@ of."
        ;; We must care about file names with spaces, or starting with
        ;; "-"; this would confuse xargs.  "ls -aQ" might be a
        ;; solution, but it does not work on all remote systems.
+       ;; Therefore, we use \000 as file separator.
+       ;; `tramp-sh--quoting-style-options' do not work for file names
+       ;; with spaces piped to "xargs".
        ;; Apostrophes in the stat output are masked as
        ;; `tramp-stat-marker', in order to make a proper shell escape
        ;; of them in file names.
-       "cd %s && echo \"(\"; (%s %s -a | "
-       "xargs %s -c "
+       "cd %s && echo \"(\"; (%s %s -a | tr '\\n\\r' '\\000\\000' | "
+       "xargs -0 %s -c "
        "'(%s%%n%s (%s%%N%s) %%h %s %s %%X %%Y %%Z %%s %s%%A%s t %%i -1)' "
        "-- 2>/dev/null | sed -e 's/\"/\\\\\"/g' -e 's/%s/\"/g'); echo \")\""))
     (tramp-shell-quote-argument localname)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]