Discussion:
[mh-e:bugs] #254 MIME tag presence detection can fail
Bill Wohler
2016-01-18 05:45:07 UTC
Permalink
- **status**: unread --> open
- **Milestone**: --> Unassigned



---

** [bugs:#254] MIME tag presence detection can fail**

**Status:** open
**Milestone:** Unassigned
**Created:** Fri May 21, 2010 12:10 AM UTC by Peter S Galbraith
**Last Updated:** Sat Feb 23, 2013 09:17 PM UTC
**Owner:** nobody


Hi all,

We currently check if MIME attachments constructs \(with part
declarations\) are present using:

\(defun mh-mml-tag-present-p \(\)
"Check if the current buffer has text which may be a MML tag."
\(save-excursion
\(goto-char \(point-min\)\)
\(re-search-forward
\(concat
"\\\\\(<\#\\\\\(mml\\\|part\\\\\)\\\\\(.\\\|\n\\\\\)\*>\[ \n\t\]\*<\#/\\\\\(mml\\\|part\\\\\)>\\\|"
"^<\#secure.+>$\\\\\)"\)
nil t\)\)\)

But in the content of the attachment may not be in a file, but in the
buffer itself. In such cases, the above may fail when ther is too much text:

Debugger entered--Lisp error: \(error "Stack overflow in regexp matcher"\)

I suggest that looking for the closing part isn't required and this
should be okay:

\(defun mh-mml-tag-present-p \(\)
"Check if the current buffer has text which may be a MML tag."
\(save-excursion
\(goto-char \(point-min\)\)
\(re-search-forward "\\\\\(<\#\\\\\(mml\\\|part\\\\\)\\\|^<\#secure.+>$\\\\\)" nil t\)\)\)



---

Sent from sourceforge.net because mh-e-***@lists.sourceforge.net is subscribed to https://sourceforge.net/p/mh-e/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/mh-e/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
Loading...