summaryrefslogtreecommitdiff
path: root/scm
diff options
context:
space:
mode:
authorMasamichi Hosoda <trueroad@trueroad.jp>2016-07-09 01:16:39 +0900
committerMasamichi Hosoda <trueroad@trueroad.jp>2016-07-14 22:57:43 +0900
commit264fa8be61f503a1c9952b70633018e752afd226 (patch)
tree794a8fb28275f199fec4d697bed2847e4212eb11 /scm
parent4164bfb62950c46517a21ad1d80131ce27868aa1 (diff)
Issue 4923/1: Add closing a file in `is-collection-fonts?`
This commit adds `close-port` for closing a file in `is-collection-fonts?`.
Diffstat (limited to 'scm')
-rw-r--r--scm/framework-ps.scm23
1 files changed, 13 insertions, 10 deletions
diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm
index bc6599c70b..6e03a3b967 100644
--- a/scm/framework-ps.scm
+++ b/scm/framework-ps.scm
@@ -288,16 +288,19 @@
(define (load-font-via-GS font-name-filename)
(define (is-collection-font? file-name)
- (let ((port (open-file file-name "rb")))
- (if (eq? (read-char port) #\t)
- (if (eq? (read-char port) #\t)
- (if (eq? (read-char port) #\c)
- (if (eq? (read-char port) #\f)
- #t
- #f)
- #f)
- #f)
- #f)))
+ (let* ((port (open-file file-name "rb"))
+ (retval
+ (if (eq? (read-char port) #\t)
+ (if (eq? (read-char port) #\t)
+ (if (eq? (read-char port) #\c)
+ (if (eq? (read-char port) #\f)
+ #t
+ #f)
+ #f)
+ #f)
+ #f)))
+ (close-port port)
+ retval))
(define (ps-load-file file-name)
(if (string? file-name)