diff options
author | Hannes Müller <> | 2024-12-21 16:55:13 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2025-02-28 22:12:03 +0100 |
commit | 5abb24efe4ab59a835a94eea6d6dd4be5da4ccba (patch) | |
tree | ad6062fb92625209a99ca53715ac7d91300b7dbe | |
parent | 25c9440e4dbe5256ed079627d7148adaa6ac0c59 (diff) | |
download | guile-5abb24efe4ab59a835a94eea6d6dd4be5da4ccba.tar.gz |
Fix make-custom-port in case encoding is #f
* module/ice-9/custom-ports.scm (make-custom-port): Code fails if
(fluid-ref %default-port-encoding) returns #f. In fact this was the
case why readline support on MSYS2 failed for guile 3.0.10, ref.
https://github.com/msys2/MSYS2-packages/issues/5079
But later used canonicalize-encoding is prepared to handle #f for
encoding. So allow encoding to also handle this case.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r-- | module/ice-9/custom-ports.scm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/ice-9/custom-ports.scm b/module/ice-9/custom-ports.scm index 6010fd94f..c4376db7b 100644 --- a/module/ice-9/custom-ports.scm +++ b/module/ice-9/custom-ports.scm @@ -127,7 +127,7 @@ (id "custom-port") (print (make-default-print #:id id)) (truncate default-truncate) - (encoding (string->symbol (fluid-ref %default-port-encoding))) + (encoding (and=> (fluid-ref %default-port-encoding) string->symbol)) (conversion-strategy (fluid-ref %default-port-conversion-strategy)) (close-on-gc? #f)) "Create a custom port whose behavior is determined by the methods passed |