* ew-dec.el (ew-decode-field-test): Support
authorakr <akr>
Thu, 27 Aug 1998 16:36:24 +0000 (16:36 +0000)
committerakr <akr>
Thu, 27 Aug 1998 16:36:24 +0000 (16:36 +0000)
`ew-permit-null-encoded-text'.

* ew-unit.el (ew-decode-eword): Check
`ew-permit-null-encoded-text'.

* ew-var.el (ew-encoded-text-regexp): Always permit null string
regardless of `ew-permit-null-encoded-text'.

ChangeLog
ew-dec.el
ew-unit.el
ew-var.el

index 2fc87e5..aa41a90 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 1998-08-27  Tanaka Akira      <akr@jaist.ac.jp>
 
+       * ew-dec.el (ew-decode-field-test): Support
+       `ew-permit-null-encoded-text'.
+
+       * ew-unit.el (ew-decode-eword): Check
+       `ew-permit-null-encoded-text'.
+
+       * ew-var.el (ew-encoded-text-regexp): Always permit null string
+       regardless of `ew-permit-null-encoded-text'.
+
+1998-08-27  Tanaka Akira      <akr@jaist.ac.jp>
+
        * ew-var.el (ew-decode-field-syntax-alist): Add few fields.
 
        * eword-decode.el (eword-decode-header): Compare decoded result
index 4c2675c..759c7d8 100644 (file)
--- a/ew-dec.el
+++ b/ew-dec.el
@@ -490,11 +490,13 @@ each line is separated by CRLF."
            (ew-ignore-76bytes-limit nil)
            (ew-permit-sticked-comment nil)
            (ew-permit-sticked-special nil)
+           (ew-permit-null-encoded-text nil)
            (options
             '(ew-ignore-76bytes-limit
               ew-ignore-75bytes-limit
               ew-permit-sticked-special
               ew-permit-sticked-comment
+              ew-permit-null-encoded-text
               ew-decode-sticked-encoded-word
               ew-decode-quoted-encoded-word
               ))
index 569c1ac..e780853 100644 (file)
            bdec cdec
            bcheck
            tmp)
-       (if (and (setq bdec (ew-byte-decoder encoding))
-                (setq cdec (ew-char-decoder charset)))
-           (if (or (null (setq bcheck (ew-byte-checker encoding)))
-                   (funcall bcheck encoding encoded-text))
-               (ew-quote (closure-call cdec (funcall bdec encoded-text)))
-             (ew-quote str))
-         (ew-quote-eword charset encoding encoded-text)))
+       (if (or ew-permit-null-encoded-text
+               (< 0 (length encoded-text)))
+           (if (and (setq bdec (ew-byte-decoder encoding))
+                    (setq cdec (ew-char-decoder charset)))
+               (if (or (null (setq bcheck (ew-byte-checker encoding)))
+                       (funcall bcheck encoding encoded-text))
+                   (ew-quote (closure-call cdec (funcall bdec encoded-text)))
+                 (ew-quote str))
+             (ew-quote-eword charset encoding encoded-text))
+         (ew-quote str)))
     (ew-quote str)))
 
 (defun ew-byte-decoder (encoding)
index 9a3e485..2463626 100644 (file)
--- a/ew-var.el
+++ b/ew-var.el
@@ -8,7 +8,7 @@
 (defvar ew-ignore-76bytes-limit nil)
 (defvar ew-permit-sticked-comment nil)
 (defvar ew-permit-sticked-special nil)
-(defvar ew-permit-null-encoded-text nil) ; affect when loading time.
+(defvar ew-permit-null-encoded-text nil)
 
 (defvar ew-remove-bare-crlf nil)
 (defvar ew-default-mime-charset 'x-ctext)
 ;;; constants.
 
 (defconst ew-token-regexp "[-!#-'*+0-9A-Z^-~]+")
-(defconst ew-encoded-text-regexp
-  (if ew-permit-null-encoded-text
-      "[!->@-~]*"
-    "[!->@-~]+"))
+(defconst ew-encoded-text-regexp "[!->@-~]*")
 
 (defconst ew-encoded-word-regexp
   (concat (regexp-quote "=?")