From ca36e71447c9dd9517b21bca810aeb49cdc521aa Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Sat, 12 Aug 2023 14:28:41 -0600 Subject: [PATCH] compat: Allow binary 'open-file' on Mes. * gash/compat.scm [mes] (open-file): Allow "rb" and "wb" modes. --- gash/compat.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gash/compat.scm b/gash/compat.scm index 7d067bd..41c6544 100644 --- a/gash/compat.scm +++ b/gash/compat.scm @@ -250,8 +250,12 @@ (define (open-file filename mode) (cond - ((string=? mode "r") (open-input-file filename)) - ((string=? mode "w") (open-output-file filename)) + ((or (string=? mode "r") + (string=? mode "rb")) + (open-input-file filename)) + ((or (string=? mode "w") + (string=? mode "wb")) + (open-output-file filename)) (else (error "Unsupported file mode" mode)))) ;; Because Mes is not careful when resolving syntax, this will