summaryrefslogtreecommitdiff
path: root/guile
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-10-05 14:30:31 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2016-10-05 20:02:39 +0200
commit8c6325363c562d3013225167e49fc82ef91330a2 (patch)
tree0cd319d3f4deaf019bd0337d0ba3dd2268de7793 /guile
parent1753fd05380660f3c87b43044b2e855a5053e8b2 (diff)
downloadgnutls-8c6325363c562d3013225167e49fc82ef91330a2.tar.gz
guile: Guile 2.x 'uniform-vector-read!' replacement returns 0 upon EOF.
This problem was never hit in practice because our tests always got the non-EOF case. * guile/modules/gnutls/build/tests.scm (uniform-vector-read!) [guile-2]: Return 0 upon EOF.
Diffstat (limited to 'guile')
-rw-r--r--guile/modules/gnutls/build/tests.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/guile/modules/gnutls/build/tests.scm b/guile/modules/gnutls/build/tests.scm
index 2fe6be2a85..2c5c573f65 100644
--- a/guile/modules/gnutls/build/tests.scm
+++ b/guile/modules/gnutls/build/tests.scm
@@ -70,7 +70,8 @@ process exits upon failure."
(else ;2.0 and 2.2
(use-modules (rnrs io ports)
- (rnrs bytevectors))
+ (rnrs bytevectors)
+ (ice-9 match))
(define-syntax-rule (define-replacement (name args ...) body ...)
;; Define a compatibility replacement for NAME, if needed.
@@ -84,8 +85,10 @@ process exits upon failure."
;; and absent in 2.2.
(define-replacement (uniform-vector-read! buf port)
- (get-bytevector-n! port buf
- 0 (bytevector-length buf)))
+ (match (get-bytevector-n! port buf
+ 0 (bytevector-length buf))
+ ((? eof-object?) 0)
+ ((? integer? n) n)))
(define-replacement (uniform-vector-write buf port)
(put-bytevector port buf))))