diff options
| author | Masaya Tojo <masaya@tojo.tokyo> | 2024-08-04 00:55:10 +0900 |
|---|---|---|
| committer | Masaya Tojo <masaya@tojo.tokyo> | 2024-08-04 00:59:27 +0900 |
| commit | c3cbea235b7299e4fc84e505fbb97acd61af1a69 (patch) | |
| tree | a844324d3e49fcfd966329e3b58b796e85af6d12 | |
| parent | 232d1c28ea6d797e01ea069f28c9e4b138117802 (diff) | |
Fix behavior of `read-number` on error
| -rw-r--r-- | pnm/read.scm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pnm/read.scm b/pnm/read.scm index 22a6a02..1f0017a 100644 --- a/pnm/read.scm +++ b/pnm/read.scm @@ -208,8 +208,9 @@ (call-with-current-continuation (lambda (return) (let ((u8 (peek-u8 in))) - (when (or (eof-object? u8) - (not (digit? u8))) + (when (eof-object? u8) + (return (eof-object))) + (when (not (digit? u8)) (return #f))) (let loop ((number 0)) (let ((u8 (peek-u8 in))) |
