Subject: bug#55274: 28.1; Tramp unable to perform Zip compression

From: Michael Albinus <[email-masked]>
Date: Fri, 06 May 2022 13:36:05 +0200

Mehmet Tekman <[email-masked]> writes:

Hi Mehmet,

> Steps to reproduce:
> ===================
> 1. Visit a remote directory via "C-x C-f"
> 2. Select a remote directory to compress by typing "c" on the
> directory
> 3. Type in a new zip name at the same level of the remote directory.
> 4. Witness error message *dired-check-progress-output* buffer:
>
>> zip I/O error: No such file or directory
>> zip error: Could not create output file
> (/ssh:user@ipadd#customport:/home/user/path/to/new/zip/myzip.zip)

Thanks for the report, I could reproduce it here. The appended patch
fixes this for me, could you pls check?

Best regards, Michael.

diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index f16568f919..e00910cfe8 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1242,7 +1242,8 @@ dired-do-compress-to
            (when (zerop
                   (dired-shell-command
                    (format-spec (cdr rule)
-                                `((?o . ,(shell-quote-argument out-file))
+                                `((?o . ,(shell-quote-argument
+                                          (file-local-name out-file)))
                                   (?i . ,(mapconcat
                                           (lambda (in-file)
                                             (shell-quote-argument