Commit a6be003b authored by Jan Idzikowski's avatar Jan Idzikowski
Browse files

Fix error dot masking in rfc2045-q-encode-string-to-stream

 - dot masking only for first character of a line
 - add test rfc2045-q-encode-string-to-stream-9
parent 8bcd1b54
Version 20180105.1
2018.01.05
Fix error dot masking in rfc2045-q-encode-string-to-stream
add new test
Thanks Borbély Tamás for the bug report and test
Change cl-smtp.asd, cl-smtp.lisp. tests.lisp CHANGELOG
Version 20170922.1 Version 20170922.1
2017.09.22 2017.09.22
Further error in rfc2045-q-encode-string-to-stream fixed Further error in rfc2045-q-encode-string-to-stream fixed
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
:licence "LLGPL" :licence "LLGPL"
:author "Jan Idzikowski <jidzikowski@common-lisp.net>" :author "Jan Idzikowski <jidzikowski@common-lisp.net>"
:maintainer "Jan Idzikowski <jidzikowski@common-lisp.net>" :maintainer "Jan Idzikowski <jidzikowski@common-lisp.net>"
:version "20170922.1" :version "20180105.1"
:perform (load-op :after (op webpage) :perform (load-op :after (op webpage)
(pushnew :cl-smtp cl:*features*)) (pushnew :cl-smtp cl:*features*))
:depends-on (:usocket :depends-on (:usocket
......
...@@ -120,8 +120,7 @@ ...@@ -120,8 +120,7 @@
(write-blank-line stream) (write-blank-line stream)
(setf last-line-break n)) (setf last-line-break n))
(cond (cond
((and (char= c #\.) (or (= n 0) (= n last-line-break) ((and (char= c #\.) (= n last-line-break))
(= last-line-break columns)))
(write-char #\. stream) (write-char #\. stream)
(write-char #\. stream)) (write-char #\. stream))
((char= c #\NewLine) ((char= c #\NewLine)
......
...@@ -85,6 +85,17 @@ n !" ...@@ -85,6 +85,17 @@ n !"
(assert qstr) (assert qstr)
(assert (string-equal qstr (format nil"12345678901234567890123456789012345678901234567890123456789012345678901234=~C~C.." #\Return #\Newline))))) (assert (string-equal qstr (format nil"12345678901234567890123456789012345678901234567890123456789012345678901234=~C~C.." #\Return #\Newline)))))
(define-cl-smtp-test "rfc2045-q-encode-string-to-stream-9" ()
(let* ((str
"123456789012345678901234567890123456789012345678901234567890123456789012345.")
(qstr (with-output-to-string (s)
(rfc2045-q-encode-string-to-stream
str s :external-format :utf-8 :columns 74))))
(assert qstr)
(assert (string-equal qstr (format
nil"12345678901234567890123456789012345678901234567890123456789012345678901234=~C~C5."
#\Return #\Newline)))))
(define-cl-smtp-test "string-has-non-ascii-1" () (define-cl-smtp-test "string-has-non-ascii-1" ()
(assert (string-has-non-ascii "test Ü ende"))) (assert (string-has-non-ascii "test Ü ende")))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment