From 1fa03d72866ece3e92c395cdd8aba863f542684c Mon Sep 17 00:00:00 2001 From: morioka Date: Sun, 21 Jun 1998 10:04:59 +0000 Subject: [PATCH] (mime-entity-safe-filename): New implementation. --- mime-play.el | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) 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 -- 1.7.10.4