diff options
author | David Thompson <davet@gnu.org> | 2015-02-05 11:57:42 -0500 |
---|---|---|
committer | David Thompson <davet@gnu.org> | 2015-02-05 11:57:42 -0500 |
commit | 3d5619c63693a196652e3b9e545995ec4919152c (patch) | |
tree | 99352948bd9d684701b5d2a476d8ffe3236a0362 | |
parent | e02bac9182c3df3bb5fa3b23332bc1bc0a742c76 (diff) |
Check for EOF when reading subtitle lines.
* srt2vtt (read-sub-rip): Test for EOF object.
-rwxr-xr-x | srt2vtt | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -66,9 +66,10 @@ two values: the start time and the end time. Valid input looks like ((start end) (parse-time-span (read-line port))) ((lines) (let loop ((lines '())) (let ((line (read-line port))) - (if (and (string-null? line) - ;; A subtitle may be a blank line! - (not (null? lines))) + (if (or (eof-object? line) + (and (string-null? line) + ;; A subtitle may be a blank line! + (not (null? lines)))) lines (loop (cons line lines))))))) (make-subtitle id start end lines))) |