GNU bug report logs - #10347
24.0.50; archive-mode includes warning messages from unzip in the content of extracted files

Previous Next

Package: emacs;

Reported by: Daniel Brooks <db48x <at> db48x.net>

Date: Thu, 22 Dec 2011 01:40:02 UTC

Severity: minor

Found in version 24.0.50

Fixed in version 24.3

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: Daniel Brooks <db48x <at> db48x.net>
Cc: 10347 <at> debbugs.gnu.org
Subject: bug#10347: 24.0.50; archive-mode includes warning messages from unzip in the content of extracted files
Date: Thu, 22 Dec 2011 22:07:05 +0200
> archive-extract-by-stdout intermingles stderr and stdout unless the
> caller passes in a buffer to send the stderr too. As none of the callers
> do, I think it would be best to disable stderr unless the caller
> supplies a buffer.

> [2. fix --- application/octet-stream; archive-mode-stdout.bundle]...

Unfortunately, I can't read what you've encrypted into this git bundle.

But I think we should use the same solution as we developed for
`archive-7z-extract' - to redirect stdout into a temporary file
and display its contents in the echo area.

This patch fixes `archive-zip-extract' by duplicating the logic of
`archive-7z-extract':

=== modified file 'lisp/arc-mode.el'
--- lisp/arc-mode.el	2011-12-15 07:24:10 +0000
+++ lisp/arc-mode.el	2011-12-22 20:05:51 +0000
@@ -1826,7 +1827,8 @@ (defun archive-zip-extract (archive name
     (let ((archive-7z-extract archive-zip-extract))
       (archive-7z-extract archive name)))
    (t
-    (archive-extract-by-stdout
+    (let ((tmpfile (make-temp-file "zip-stderr")))
+      (prog1 (archive-extract-by-stdout
      archive
      ;; unzip expands wildcards in NAME, so we need to quote it.  But
      ;; not on DOS/Windows, since that fails extraction on those
@@ -1839,7 +1841,13 @@ (defun archive-zip-extract (archive name
 	      (equal (car archive-zip-extract) "unzip"))
 	 (shell-quote-argument name)
        name)
-     archive-zip-extract))))
+	      archive-zip-extract
+	      tmpfile)
+	(with-temp-buffer
+	  (insert-file-contents tmpfile)
+	  (unless (search-forward "Everything is Ok" nil t)
+	    (message "%s" (buffer-string)))
+	  (delete-file tmpfile)))))))
 
 (defun archive-zip-write-file-member (archive descr)
   (archive-*-write-file-member




This bug report was last modified 12 years and 239 days ago.

Previous Next


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