* gnus-art.el (gnus-header-from, gnus-header-subject, gnus-header-name)
[gnus] / lisp / rfc2231.el
index 05a3440..452897f 100644 (file)
@@ -1,7 +1,7 @@
 ;;; rfc2231.el --- Functions for decoding rfc2231 headers
 
-;; Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005,
-;;   2006 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
@@ -162,14 +162,14 @@ must never cause a Lisp error."
                          (buffer-substring
                           (point)
                           (progn
-                            (forward-sexp)
-                            ;; We might not have reached at the end of
-                            ;; the value because of non-ascii chars,
-                            ;; so we should jump over them if any.
-                            (while (and (not (eobp))
-                                        (> (char-after) ?\177))
+                            ;; Jump over asterisk, non-ASCII
+                            ;; and non-boundary characters.
+                            (while (and c
+                                        (or (eq c ?*)
+                                            (> c ?\177)
+                                            (not (eq (char-syntax c) ? ))))
                               (forward-char 1)
-                              (forward-sexp))
+                              (setq c (char-after)))
                             (point)))))
                   (t
                    (error "Invalid header: %s" string)))