]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp.el (tramp-find-inline-compress)
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 10 Jan 2011 20:36:09 +0000 (21:36 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 10 Jan 2011 20:36:09 +0000 (21:36 +0100)
(tramp-get-inline-coding): Quote command after pipe symbol for
local calls under W32.  (Bug#6784)

lisp/ChangeLog
lisp/net/tramp.el

index c0607190341d3d6c42979cd8d77bc7c616273d3b..fc51f86bc379caa8fc6419a5c29500ac8a526d14 100644 (file)
@@ -1,3 +1,9 @@
+2011-01-10  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (tramp-find-inline-compress)
+       (tramp-get-inline-coding): Quote command after pipe symbol for
+       local calls under W32.  (Bug#6784)
+
 2011-01-10  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp.el (tramp-default-method): Initialize with pscp/plink
index 4fb8d7b786262d9ddcf6850f92572569b8b2fb27..c40d65ca913690f8da118a966cdbfec5599dd3cc 100644 (file)
@@ -7362,9 +7362,17 @@ Goes through the list `tramp-inline-compress-commands'."
           vec 5
           "Checking local compress command `%s', `%s' for sanity"
           compress decompress)
-         (unless (zerop (tramp-call-local-coding-command
-                         (format "echo %s | %s | %s"
-                                 magic compress decompress) nil nil))
+         (unless
+             (zerop
+              (tramp-call-local-coding-command
+               (format
+                ;; Windows shells need the program file name after
+                ;; the pipe symbol be quoted if they use forward
+                ;; slashes as directory separators.
+                (if (memq system-type '(windows-nt))
+                    "echo %s | \"%s\" | \"%s\""
+                  "echo %s | %s | %s")
+                magic compress decompress) nil nil))
            (throw 'next nil))
          (tramp-message
           vec 5
@@ -8645,9 +8653,25 @@ function cell is returned to be applied on a buffer."
         ((symbolp coding)
          coding)
         ((and compress (string-match "decoding" prop))
-         (format "(%s | %s >%%s)" coding compress))
+         (format
+          ;; Windows shells need the program file name after
+          ;; the pipe symbol be quoted if they use forward
+          ;; slashes as directory separators.
+          (if (and (string-match "local" prop)
+                   (memq system-type '(windows-nt)))
+              "(%s | \"%s\" >%%s)"
+            "(%s | %s >%%s)")
+          coding compress))
         (compress
-         (format "(%s <%%s | %s)" compress coding))
+         (format
+          ;; Windows shells need the program file name after
+          ;; the pipe symbol be quoted if they use forward
+          ;; slashes as directory separators.
+          (if (and (string-match "local" prop)
+                   (memq system-type '(windows-nt)))
+              "(%s <%%s | \"%s\")"
+            "(%s <%%s | %s)")
+          compress coding))
         ((string-match "decoding" prop)
          (format "%s >%%s" coding))
         (t