* (TESTPAT): add test result by FLIM-FLAM. flam-1_9_0
authorakr <akr>
Sat, 18 Jul 1998 23:22:33 +0000 (23:22 +0000)
committerakr <akr>
Sat, 18 Jul 1998 23:22:33 +0000 (23:22 +0000)
* eword-decode.el (eword-lexical-analyze-internal): restrict
calling `eword-analyze-encoded-word' after calling
`eword-analyze-spaces'.

ChangeLog
TESTPAT
eword-decode.el

index 059c0f9..a6e8ccc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 1998-07-18  Tanaka Akira  <akr@jaist.ac.jp>
 
+       * (TESTPAT): add test result by FLIM-FLAM.
+
+       * eword-decode.el (eword-lexical-analyze-internal): restrict
+       calling `eword-analyze-encoded-word' after calling
+       `eword-analyze-spaces'.
+
+1998-07-18  Tanaka Akira  <akr@jaist.ac.jp>
+
        * (TESTPAT): add test.
 
        * eword-decode.el (eword-analyze-quoted-string): quote string as
diff --git a/TESTPAT b/TESTPAT
index 82f0605..5df90d1 100644 (file)
--- a/TESTPAT
+++ b/TESTPAT
@@ -76,6 +76,7 @@
 "From: Nathaniel Borenstein <nsb@thumper.bellcore.com>
        (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)"
 "From: Nathaniel Borenstein <nsb@thumper.bellcore.com> (\e.H\eNm\eNe\eNl\eNy \eNo\eNa \eNi\eNl\eNh\eNt\eNp)")\e*B
+; FLIM-FLAM
 
 (decode
 "From: foo@bar.baz (=?ISO-8859-1?Q?a?=)"
 "From: akr@jaist.ac.jp
  (=?ISO-2022-JP?B?GyRCJCIbKEI=?=\\a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)"
 "From: akr@jaist.ac.jp (\e$B$"\e(B\\a\e$B$$\e(B)")
+; FLIM-FLAM
 
 (decode
 "From: akr@jaist.ac.jp
  (=?ISO-2022-JP?B?GyRCJCIbKEI=?=a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)"
 "From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)")
+; FLIM-FLAM
 
 (decode
 "From: akr@jaist.ac.jp
  (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)"
 "From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)")
+; FLIM-FLAM
 
 (decode
 "From: akr@jaist.ac.jp
 "From: akr@jaist.ac.jp
  (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)"
 'ignore-76bytes-limit)
+; FLIM-FLAM
 
 (decode
 "From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=
  =?ISO-2022-JP?B?GyhC?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=
  =?ISO-2022-JP?B?GyhC?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)"
 'zero-characters-encoded-word-hack)
+; FLIM-FLAM
 
 (decode
 "From: a=?ISO-2022-JP?B?GyRCJCIbKEI=?= <akr@jaist.ac.jp>"
 (decode
 "From: < =?ISO-2022-JP?B?GyRCJCIbKEI=?= @jaist.ac.jp>"
 "From: < =?ISO-2022-JP?B?GyRCJCIbKEI=?= @jaist.ac.jp>")
+; FLIM-FLAM
 
 (decode
 "From: =?ISO-2022-JP?Q?=1B=24BAA=1B=28B?= <akr@jaist.ac.jp>"
 (encode
 "From: \"\e$B$"\e(B(\e$B$"\e(B)\" <akr@jaist.ac.jp>"
 "From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= <akr@jaist.ac.jp>")
+; FLIM-FLAM
 
 (decode
 "From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= <akr@jaist.ac.jp>"
 "From: \e$B$"\e(B(\e$B$"\e(B) <akr@jaist.ac.jp>"
 "From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= <akr@jaist.ac.jp>"
 'encode-sticked-comment-as-atom)
+; FLIM-FLAM
 
 (encode
 "From: \e$B$"\e(B(\e$B$"\e(B) <akr@jaist.ac.jp>"
 "From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCIbKEI=?=)
  <akr@jaist.ac.jp>"
 'permit-sticked-comment)
+; FLIM-FLAM
 
 (encode
 "From: \e$B$"\e(B(\e$B$"\e(B) <akr@jaist.ac.jp>"
 "From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= (=?ISO-2022-JP?B?GyRCJCIbKEI=?=)
  <akr@jaist.ac.jp>"
 'separate-sticked-comment)
+; FLIM-FLAM
 
 (decode
 "From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCIbKEI=?=)
 (encode
 "From: \"a\\\"b\e$B$"\e(Bc\\\\\" <akr@jaist.ac.jp>"
 "From: =?ISO-2022-JP?B?YSJiGyRCJCIbKEJjXA==?= <akr@jaist.ac.jp>")
+; FLIM-FLAM
 
 (decode
 "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
 "To: \e$B$"\e(B<akr@jaist.ac.jp>"
 "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
 'permit-sticked-special)
+; FLIM-FLAM
 
 (encode
 "To: \e$B$"\e(B<akr@jaist.ac.jp>"
 "To: <akr@jaist.ac.jp>,\e$B$"\e(B<akr@jaist.ac.jp>"
 "To: <akr@jaist.ac.jp>,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
 'permit-sticked-special)
+; FLIM-FLAM
 
 (encode
 "To: <akr@jaist.ac.jp>,\e$B$"\e(B<akr@jaist.ac.jp>"
 "To: akr@jaist.ac.jp,\e$B$"\e(B<akr@jaist.ac.jp>"
 "To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=<akr@jaist.ac.jp>"
 'permit-sticked-special)
+; FLIM-FLAM
 
 (encode
 "To: akr@jaist.ac.jp,\e$B$"\e(B<akr@jaist.ac.jp>"
 "To: \e$B$"\e(B:akr@jaist.ac.jp;"
 "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;"
 'permit-sticked-special)
+; FLIM-FLAM
 
 (encode
 "To: \e$B$"\e(B:akr@jaist.ac.jp;"
 "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= :akr@jaist.ac.jp;"
 'separate-sticked-special)
+; FLIM-FLAM
 
 (decode
 "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<akr@jaist.ac.jp>;"
 "To: \e$B$"\e(B:\e$B$$\e(B<akr@jaist.ac.jp>;"
 "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<akr@jaist.ac.jp>;"
 'ignore-76bytes-limit 'permit-sticked-special)
+; FLIM-FLAM
 
 (encode
 "To: \e$B$"\e(B:\e$B$$\e(B<akr@jaist.ac.jp>;"
 "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=
  =?ISO-2022-JP?B?GyhC?=<akr@jaist.ac.jp>;"
 'zero-characters-encoded-word-hack 'permit-sticked-special)
+; FLIM-FLAM
 
 (encode
 "To: \e$B$"\e(B:\e$B$$\e(B<akr@jaist.ac.jp>;"
 "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= : =?ISO-2022-JP?B?GyRCJCQbKEI=?=
  <akr@jaist.ac.jp>;"
 'separate-sticked-special)
+; FLIM-FLAM
 
 (decode
 "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>"
 "To: \e$B$"\e(B:\e$B$$\e(B<foo@bar>,\e$B$&\e(B<foo@bar>;,\e$B$(\e(B<foo@bar>"
 "To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>"
 'ignore-76bytes-limit 'permit-sticked-special)
+; FLIM-FLAM
 
 (encode
 "To: \e$B$"\e(B:\e$B$$\e(B<foo@bar>,\e$B$&\e(B<foo@bar>;,\e$B$(\e(B<foo@bar>"
  =?ISO-2022-JP?B?GyhC?=<foo@bar>,=?ISO-2022-JP?B?GyRCJCYbKEI=?=
  =?ISO-2022-JP?B?GyhC?=<foo@bar>;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=<foo@bar>"
 'zero-characters-encoded-word-hack 'permit-sticked-special)
+; FLIM-FLAM
 
 (encode
 "To: \e$B$"\e(B:\e$B$$\e(B<foo@bar>,\e$B$&\e(B<foo@bar>;,\e$B$(\e(B<foo@bar>"
  <foo@bar>, =?ISO-2022-JP?B?GyRCJCYbKEI=?= <foo@bar>;,
  =?ISO-2022-JP?B?GyRCJCgbKEI=?= <foo@bar>"
 'separate-sticked-special)
+; FLIM-FLAM
 
 (decode
 "Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?="
 (decode
 "Subject: =?US-ASCII?Q?a=0D=0A_b?="
 "Subject: a b")
+; FLIM-FLAM
 
 (decode
 "Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?= a
  =?ISO-2022-JP?B?GyRCJCQbKEI=?="
-"From: \e$B$"\e(B a \e$B$$\e(B")
+"Subject: \e$B$"\e(B a \e$B$$\e(B")
 
 (encode
 "Subject: \e$B0$\e(B                                                                                                                          \e$BR_\e(B"
 "Subject: =?ISO-2022-JP?B?GyRCMCQbKEIgICAgICAgICAgICAgICAgICAgICAgICAgICAg?=
  =?US-ASCII?Q?____________________________________________________________?=
  =?ISO-2022-JP?B?ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBskQlJfGyhC?=")
+; FLIM-FLAM
 
 (decode
 "Subject: =?ISO-2022-JP?B?GyRCMCQbKEIgICAgICAgICAgICAgICAgICAgICAgICAgICAg?=
 "Subject: \e$B0$\e(B                                                                                                                          \e$BR_\e(B"
 "Subject: =?ISO-2022-JP?B?GyQpQrCkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDS3w=="
 'ignore-76bytes-limit 'ignore-75bytes-limit)
+; FLIM-FLAM
 
 (decode
 "Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?="
 (encode
 "From: \"abcdefghijklmnopqrst\e.A\eN!()\\\"\\\\\" <akr@jaist.ac.jp>"\e*B
 "From: =?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29=22=5C?= <akr@jaist.ac.jp>")
+; FLIM-FLAM
 
 (encode
 "From: akr@jaist.ac.jp (abcdefghijklmnopqrst\e.A\eN!\\(\\)\"\\\\)"\e*B
 "From: akr@jaist.ac.jp (=?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29\"=5C?=)")
+; FLIM-FLAM
 
 (decode
 "Subject: ?= =?"
 (encode
 "Subject: \e.H\eN`\e$BNm\e(B"\e*B
 "Subject: =?ISO-8859-8?Q?=E0?= =?ISO-2022-JP?B?GyRCTm0bKEI=?=")
+; FLIM-FLAM
 
 (decode
 "Subject: =?ISO-8859-8?Q?=E0_?= =?ISO-2022-JP?B?GyRCTm0bKEI=?="
index c8a4a0f..4663610 100644 (file)
@@ -644,17 +644,24 @@ be the result."
              ))))
 
 (defun eword-lexical-analyze-internal (string must-unfold)
-  (let (dest ret)
+  (let ((last 'eword-analyze-spaces)
+        dest ret)
     (while (not (string-equal string ""))
       (setq ret
-           (let ((rest eword-lexical-analyzers)
-                 func r)
-             (while (and (setq func (car rest))
-                         (null (setq r (funcall func string must-unfold)))
-                         )
-               (setq rest (cdr rest)))
-             (or r `((error . ,string) . ""))
-             ))
+            (let ((rest eword-lexical-analyzers)
+                  func r)
+              (while (and (setq func (car rest))
+                          (or
+                           (and
+                            (not eword-decode-sticked-encoded-word)
+                            (not (eq last 'eword-analyze-spaces))
+                            (eq func 'eword-analyze-encoded-word))
+                           (null (setq r (funcall func string must-unfold))))
+                          )
+                (setq rest (cdr rest)))
+              (setq last func)
+              (or r `((error . ,string) . ""))
+              ))
       (setq dest (cons (car ret) dest))
       (setq string (cdr ret))
       )