From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#5475: Archives with filenames with square brackets Date: Sun, 31 Jan 2010 12:56:19 +0200 Organization: JURTA Message-ID: <87aavua6gb.fsf@mail.jurta.org> References: <874omakv2m.fsf@mail.jurta.org> <87eilca86n.fsf@stupidchicken.com> <83r5pc4jye.fsf@gnu.org> <87vden4h9x.fsf@stupidchicken.com> <83ljfj4fje.fsf@gnu.org> <87r5pavvrm.fsf@stupidchicken.com> <838wbiszy7.fsf@gnu.org> <87y6jfcg8b.fsf@mail.jurta.org> <83d40qj4av.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1264937255 8519 80.91.229.12 (31 Jan 2010 11:27:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Jan 2010 11:27:35 +0000 (UTC) Cc: 5475@debbugs.gnu.org, cyd@stupidchicken.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 31 12:27:32 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NbXxj-0000Fx-LA for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Jan 2010 12:27:31 +0100 Original-Received: from localhost ([127.0.0.1]:48199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NbXxi-0004ch-Ux for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Jan 2010 06:27:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NbXxd-0004cJ-Gp for bug-gnu-emacs@gnu.org; Sun, 31 Jan 2010 06:27:25 -0500 Original-Received: from [199.232.76.173] (port=50908 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NbXxc-0004c7-6N for bug-gnu-emacs@gnu.org; Sun, 31 Jan 2010 06:27:24 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NbXxZ-0005Vc-JK for bug-gnu-emacs@gnu.org; Sun, 31 Jan 2010 06:27:23 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40533) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NbXxY-0005V8-Pn for bug-gnu-emacs@gnu.org; Sun, 31 Jan 2010 06:27:21 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NbXXA-0002oJ-8F; Sun, 31 Jan 2010 06:00:04 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Jan 2010 11:00:04 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5475 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5475-submit@debbugs.gnu.org id=B5475.126493556810757 (code B ref 5475); Sun, 31 Jan 2010 11:00:04 +0000 Original-Received: (at 5475) by debbugs.gnu.org; 31 Jan 2010 10:59:28 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NbXWZ-0002nS-Bi for submit@debbugs.gnu.org; Sun, 31 Jan 2010 05:59:27 -0500 Original-Received: from smtp-out3.starman.ee ([85.253.0.5] helo=mx1.starman.ee) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NbXWW-0002nH-Q6 for 5475@debbugs.gnu.org; Sun, 31 Jan 2010 05:59:25 -0500 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (62.65.210.88.cable.starman.ee [62.65.210.88]) by mx1.starman.ee (Postfix) with ESMTP id 7D8813F40BC; Sun, 31 Jan 2010 12:59:15 +0200 (EET) In-Reply-To: <83d40qj4av.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 31 Jan 2010 06:18:00 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 31 Jan 2010 06:00:04 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34823 Archived-At: >> 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/