From: morioka Date: Sun, 21 Jun 1998 10:04:59 +0000 (+0000) Subject: (mime-entity-safe-filename): New implementation. X-Git-Tag: semi-1_7_1~22 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fa03d72866ece3e92c395cdd8aba863f542684c;p=elisp%2Fsemi.git (mime-entity-safe-filename): New implementation. --- diff --git a/mime-play.el b/mime-play.el index b5f1ac0..1711d81 100644 --- a/mime-play.el +++ b/mime-play.el @@ -295,14 +295,19 @@ window.") "\\(\\." mime-view-file-name-char-regexp "+\\)*")) (defun mime-entity-safe-filename (entity) - (replace-as-filename - (or (mime-entity-filename entity) - (let ((ret (or (mime-entity-read-field entity 'Content-Description) - (mime-entity-read-field entity 'Subject)))) - (if (or (string-match mime-view-file-name-regexp-1 ret) - (string-match mime-view-file-name-regexp-2 ret)) - (substring ret (match-beginning 0)(match-end 0)) - ))))) + (let ((filename + (or (mime-entity-filename entity) + (let ((subj + (or (mime-entity-read-field entity 'Content-Description) + (mime-entity-read-field entity 'Subject)))) + (if (and subj + (or (string-match mime-view-file-name-regexp-1 subj) + (string-match mime-view-file-name-regexp-2 subj))) + (substring subj (match-beginning 0)(match-end 0)) + ))))) + (if filename + (replace-as-filename filename) + ))) ;;; @ file extraction