Merge pull request #3 from samth/fix-qp

Handle unexpected eof after =.
This commit is contained in:
Jay McCarthy 2015-04-10 16:29:15 -04:00
commit 4418442d33
2 changed files with 5 additions and 1 deletions

View File

@ -77,6 +77,9 @@
(loop (read-byte in))
;; Not a LF? Well, ok.
(loop next-next)))]
[(eof-object? next)
(warning "Illegal qp sequence: `='")
(display "=" out)]
[(hex-digit? next)
(let ([next-next (read-byte in)])
(cond [(eof-object? next-next)

View File

@ -79,7 +79,8 @@
do (check-same-all base64-encode-stream
base64-decode-stream
#rx#"^[0-9a-zA-Z+=/]*$"
72)))
72))
(test (qp-decode #"=20=") #" ="))
#|
Use this to compare base64 encode/decode against the unix utilities