From f8214b8f1bb10880d319d5e4c6ad4c539a53d373 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Tue, 9 Jun 2026 08:42:29 +0200 Subject: [PATCH] tagfile wchar fix. --- taglib.rkt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/taglib.rkt b/taglib.rkt index c917021..5314447 100644 --- a/taglib.rkt +++ b/taglib.rkt @@ -137,15 +137,17 @@ (make-tags-picture mimetype kind bm #:description description)) (define (open-tag-file file) - (if (eq? (system-type 'os) 'windows) - (let ((tag-file (taglib_file_new_wchar file))) - (if (and tag-file (taglib_file_is_valid tag-file)) - tag-file - #f)) - (let ((tag-file (taglib_file_new file))) - (if (and tag-file (taglib_file_is_valid tag-file)) - tag-file - #f)))) + (let ((tag-file (if (eq? (system-type 'os) 'windows) + (taglib_file_new_wchar file) + (taglib_file_new file)))) + (cond + ((eq? tag-file #f) #f) + ((taglib_file_is_valid tag-file) tag-file) + (else + (taglib_file_free tag-file) + #f)) + ) + ) (define (read-property-map tag-file) (define key-store (make-hash))