GNU bug report logs - #5475
Archives with filenames with square brackets

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Mon, 25 Jan 2010 17:58:02 UTC

Severity: normal

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 5475 <at> debbugs.gnu.org, cyd <at> stupidchicken.com
Subject: bug#5475: Archives with filenames with square brackets
Date: Sun, 31 Jan 2010 12:56:19 +0200
>> The default value of `archive-zip-extract' can be either "unzip" or
>> "pkunzip" (depending on the presence of the executable in `exec-path'),
>> but the function `archive-zip-extract' compares with the value "pkzip".
>> So the pkzip/pkunzip branch is never executed.
>>
>> It seems the intention of the change revno#45347 (2002-05-19) was
>> to compare with "pkunzip" instead of "pkzip"
>
> Right, looks like a bug.
>
> Btw, I looked into 7z, and it doesn't have the same problem as unzip.
> So we probably should only quote with unzip.

Does the following patch look right?  At least, it fixes a bug, and
after feature freeze we could add more data structures to defcustom to
indicate whether the file name needs to be quoted.

=== modified file 'lisp/arc-mode.el'
--- lisp/arc-mode.el	2010-01-28 20:06:36 +0000
+++ lisp/arc-mode.el	2010-01-31 10:55:14 +0000
@@ -1782,12 +1782,13 @@ (defun archive-zip-summarize ()
     (apply 'vector (nreverse files))))
 
 (defun archive-zip-extract (archive name)
-  (if (equal (car archive-zip-extract) "pkzip")
-      (archive-*-extract archive name archive-zip-extract)
-    ;; unzip expands wildcards in NAME, so we need to quote it.
-    ;; FIXME: Does pkzip need similar treatment?
-    (archive-extract-by-stdout archive (shell-quote-argument name)
-			       archive-zip-extract)))
+  (if (equal (car archive-zip-extract) "unzip")
+      ;; unzip expands wildcards in NAME, so we need to quote it.
+      ;; FIXME: Does pkzip need similar treatment?
+      ;; (7z doesn't need to quote wildcards)
+      (archive-extract-by-stdout archive (shell-quote-argument name)
+				 archive-zip-extract)
+    (archive-*-extract archive name archive-zip-extract)))
 
 (defun archive-zip-write-file-member (archive descr)
   (archive-*-write-file-member


-- 
Juri Linkov
http://www.jurta.org/emacs/




This bug report was last modified 15 years and 37 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.