Handle unexpected eof after =.

This commit is contained in:
Sam Tobin-Hochstadt 2015-04-09 13:44:53 -04:00
parent c239ef7327
commit a38834ebf2
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