[mew-dist 29246] Re: zip

Yu-ji Hosokawa <[email protected]>
Newsgroups gmane.mail.mew.general.japanese
Message-ID <[email protected]>

 Cover.txt  Z 
C-c C-c  C-c C-m 


 Debian GNU/Linux lenny  zip 2.32 
Cygwin  zip 3.0 

 zip 
"zip" does not support encryption 



Cygwin  zip 3.0
| $ zip -P "" hoge.txt.zip hoge.txt
|
| zip error: Invalid command arguments (zero length password not allowed)

Debian  zip 2.32
|$ zip -P "" hoge.txt.zip hoge.txt
|  adding: hoge.txt (deflated 33%)
|$ unzip hoge.txt.zip
|Archive:  hoge.txt.zip
|[hoge.txt.zip] hoge.txt password:
|replace hoge.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: r
|new name: hoge_.txt
|  inflating: hoge_.txt
|$ diff hoge.txt hoge_.txt


diff --git a/mew-attach.el b/mew-attach.el
index 5feacc9..45f4a2f 100644
--- a/mew-attach.el
+++ b/mew-attach.el
@@ -634,7 +634,7 @@ is not effective other objects. For example, JPEG is already compressed."
 (defun mew-attach-zip ()
   "Put the 'Z' mark and encrypt it with \"zip\" in attachments."
   (interactive)
-  (if (not (mew-attach-not-line0-1-dot))
+  (if (not (mew-attach-not-line02-1-dot))
       (message "Cannot encrypt with zip here")
     (let* ((nums (mew-syntax-nums))
 	   (syntax (mew-syntax-get-entry mew-encode-syntax nums))
@@ -661,7 +661,9 @@ is not effective other objects. For example, JPEG is already compressed."
 		;; variety of zip versions.
 		(call-process mew-prog-zip nil nil nil "-P" password zname name)
 		(if (not (file-exists-p zfullname))
-		    (message "\"zip\" does not support encryption")
+                    (if (string= password "")
+                        (message "\"zip\" does not allow zero length password")
+                      (message "\"zip\" does not support encryption"))
 		  (mew-syntax-set-ct syntax (list zct))
 		  (mew-syntax-set-cte syntax mew-b64)
 		  (mew-syntax-set-file syntax zname)


-- 
Yu-ji Hosokawa ()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.