From: morioka Date: Sun, 28 Jun 1998 22:17:24 +0000 (+0000) Subject: (mime-parse-multipart): Change media-type of entity to X-Git-Tag: chao-1_7_0-199811302358~8 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=1d7c4a391c13faf34d14375b441d6e2b43e29255;p=elisp%2Fflim.git (mime-parse-multipart): Change media-type of entity to application/octet-stream if the first delimiter is not found. --- diff --git a/mime-parse.el b/mime-parse.el index 7e0edf5..b198b96 100644 --- a/mime-parse.el +++ b/mime-parse.el @@ -166,9 +166,7 @@ If is is not found, return DEFAULT-ENCODING." (make-mime-content-type 'text 'plain) )) (header-end (mime-entity-header-end-internal entity)) - (body-end (mime-entity-body-end-internal entity)) - (node-id (mime-entity-node-id-internal entity)) - cb ce ret ncb children (i 0)) + (body-end (mime-entity-body-end-internal entity))) (save-restriction (goto-char body-end) (narrow-to-region header-end @@ -176,30 +174,36 @@ If is is not found, return DEFAULT-ENCODING." (match-beginning 0) body-end)) (goto-char header-end) - (re-search-forward rsep nil t) - (setq cb (match-end 0)) - (while (re-search-forward rsep nil t) - (setq ce (match-beginning 0)) - (setq ncb (match-end 0)) - (save-restriction - (narrow-to-region cb ce) - (setq ret (mime-parse-message dc-ctl (cons i node-id) - representation-type)) - ) - (setq children (cons ret children)) - (goto-char (setq cb ncb)) - (setq i (1+ i)) - ) - (setq ce (point-max)) - (save-restriction - (narrow-to-region cb ce) - (setq ret (mime-parse-message dc-ctl (cons i node-id) - representation-type)) - ) - (setq children (cons ret children)) - ) - (mime-entity-set-children-internal entity (nreverse children)) - entity)) + (if (re-search-forward rsep nil t) + (let ((cb (match-end 0)) + ce ncb ret children + (node-id (mime-entity-node-id-internal entity)) + (i 0)) + (while (re-search-forward rsep nil t) + (setq ce (match-beginning 0)) + (setq ncb (match-end 0)) + (save-restriction + (narrow-to-region cb ce) + (setq ret (mime-parse-message dc-ctl (cons i node-id) + representation-type)) + ) + (setq children (cons ret children)) + (goto-char (setq cb ncb)) + (setq i (1+ i)) + ) + (setq ce (point-max)) + (save-restriction + (narrow-to-region cb ce) + (setq ret (mime-parse-message dc-ctl (cons i node-id) + representation-type)) + ) + (setq children (cons ret children)) + (mime-entity-set-children-internal entity (nreverse children)) + ) + (mime-entity-set-content-type-internal + entity (make-mime-content-type 'application 'octet-stream)) + ))) + entity) (defun mime-parse-encapsulated (entity) (mime-entity-set-children-internal