Forbid empty string input to string->preserve

This commit is contained in:
Tony Garnock-Jones 2018-10-02 13:02:12 +01:00
parent 50eec6ba8e
commit 374ab89cd0
1 changed files with 2 additions and 0 deletions

View File

@ -496,6 +496,8 @@
(define (string->preserve s)
(define p (open-input-string s))
(define v (read-preserve p))
(when (eof-object? v)
(parse-error* p "Unexpected end of input"))
(skip-whitespace* p)
(when (not (eof-object? (peek-char p)))
(parse-error* p "Unexpected text following preserve"))