Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
Subject: Removing ignore-errors in mm-dissect-buffer
Date: Wed, 15 Feb 2006 17:57:40 +0100	[thread overview]
Message-ID: <v9wtfwo8zf.fsf@marauder.physik.uni-ulm.de> (raw)

Hi,

Gnus errors out with "forward-sexp: Scan error: "Unbalanced
parentheses", 21, 32" when displaying the following spam article:

,----[ http://theotp1.physik.uni-ulm.de/~ste/tmp/gmane.emacs.diffs.46183 ]
| Newsgroups: gmane.emacs.diffs
| Subject: Core@mindyfunk.com
| Date: Sun, 12 Feb 2006 22:41:42 -0500 (EST)
| Message-ID: <20060213034142.06497AA36A4@max.barkingdogstudios.com>
| Mime-Version: 1.0
| Content-Type: multipart/mixed; boundary=fc55ff24ae7d5dde3b9cddf90cbc0f08
`----

The culprit is the string «charset=\"us-ascii\"» in the first MIME
part which might be invalid:

,----
| --fc55ff24ae7d5dde3b9cddf90cbc0f08
| Content-Type: text/html; charset=\"us-ascii\"
| MIME-Version: 1.0
| Content-Transfer-Encoding: quoted-printable
`----

But Gnus should render the article despite of the broken charset
declaration, I think.

To reproduce (even from «emacs -Q»), eval the following code:

--8<---------------cut here---------------start------------->8---
(require 'mail-parse)
(with-temp-buffer
  (insert "Content-Type: text/html; charset=\\\"us-ascii\\\"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable")
  (setq ct (mail-fetch-field "content-type")
	ctl (and ct (mail-header-parse-content-type ct))))
--8<---------------cut here---------------end--------------->8---

Reverting mm-decode.el to revision 7.37 fixed the problem:

--8<---------------cut here---------------start------------->8---
--- mm-decode.el	15 Feb 2006 17:33:53 +0100	7.37
+++ mm-decode.el	15 Feb 2006 17:33:26 +0100	7.38
@@ -534,13 +534,13 @@
 		  loose-mime
 		  (mail-fetch-field "mime-version"))
 	  (setq ct (mail-fetch-field "content-type")
-		ctl (ignore-errors (mail-header-parse-content-type ct))
+		ctl (and ct (mail-header-parse-content-type ct))
 		cte (mail-fetch-field "content-transfer-encoding")
 		cd (mail-fetch-field "content-disposition")
 		description (mail-fetch-field "content-description")
 		id (mail-fetch-field "content-id"))
 	  (unless from
-		(setq from (mail-fetch-field "from")))
+	    (setq from (mail-fetch-field "from")))
 	  ;; FIXME: In some circumstances, this code is running within
 	  ;; an unibyte macro.  mail-extract-address-components
 	  ;; creates unibyte buffers. This `if', though not a perfect

[...]
--8<---------------cut here---------------end--------------->8---

If reverting the following changes is not the right thing, could you
suggest a better approach, Katsumi?

,----
| 2006-02-07  Katsumi Yamaoka  <yamaoka@jpl.org>
| 
| 	* gnus-art.el (article-decode-charset): Don't use ignore-errors
| 	when calling mail-header-parse-content-type.
| 	(article-de-quoted-unreadable): Ditto.
| 	(article-de-base64-unreadable): Ditto.
| 	(article-wash-html): Ditto.
| 
| 	* mm-decode.el (mm-dissect-buffer): Don't use ignore-errors when
| 	calling mail-header-parse-content-type and
| 	mail-header-parse-content-disposition.
| 	(mm-find-raw-part-by-type): Don't use ignore-errors when calling
| 	mail-header-parse-content-type.
| [...]
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




             reply	other threads:[~2006-02-15 16:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-15 16:57 Reiner Steib [this message]
2006-02-15 23:38 ` Katsumi Yamaoka
2006-02-16  8:23   ` Katsumi Yamaoka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v9wtfwo8zf.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).