guile-email discussion
 help / color / mirror / Atom feed
* Fix tests with Guile 3.0.7
@ 2021-09-29 12:53 Mathieu Othacehe
  2021-10-01 19:58 ` Arun Isaac
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Othacehe @ 2021-09-29 12:53 UTC (permalink / raw)
  To: guile-email

[-- Attachment #1: Type: text/plain, Size: 86 bytes --]


Hello,

This patch fixes the tests when building with Guile 3.0.7.

Thanks,

Mathieu

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-email-Do-not-use-an-empty-bytevector-to-test-the-cha.patch --]
[-- Type: text/x-patch, Size: 1083 bytes --]

From c21fe0f0e28b80b606973d3e372e2bc8528c9766 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Wed, 29 Sep 2021 12:47:35 +0000
Subject: [PATCH 1/1] email: Do not use an empty bytevector to test the
 charset.

Using an empty bytevector no longer throws an exception since this Guile
commit: 5ea8c69e9153a970952bf6f0b32c4fad6a28e839.

* email/email.scm (post-process-content-transfer-encoding): Use a bytevector
containg the 'e' character to test the charset validity.
---
 email/email.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/email/email.scm b/email/email.scm
index 3f4e194..ac70463 100644
--- a/email/email.scm
+++ b/email/email.scm
@@ -832,7 +832,8 @@ values. The returned headers is a string and body is a bytevector."
   (define (valid-charset? charset)
     (catch #t
       (lambda ()
-        (bytevector->string (make-bytevector 0 0) charset)
+        ;; Try to convert a bytevector containg the 'e' character.
+        (bytevector->string (make-bytevector 1 48) charset)
         #t)
       (const #f)))
 
-- 
2.33.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix tests with Guile 3.0.7
  2021-09-29 12:53 Fix tests with Guile 3.0.7 Mathieu Othacehe
@ 2021-10-01 19:58 ` Arun Isaac
  2021-10-06  8:58   ` Arun Isaac
  0 siblings, 1 reply; 3+ messages in thread
From: Arun Isaac @ 2021-10-01 19:58 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: guile-email


[-- Attachment #1.1: Type: text/plain, Size: 258 bytes --]


Hi Mathieu,

Thanks for figuring this out! Instead of the unit length bytevector with
an 'e' character, can we just use a unit length bytevector with the null
character? That would be less surprising to the reader. WDYT? See
attached patch.

Regards,
Arun


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-email-Do-not-use-an-empty-bytevector-to-test-the-cha.patch --]
[-- Type: text/x-patch, Size: 1077 bytes --]

From 2f58690d2489a5bbacef77cf6a9143aae464e54a Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Wed, 29 Sep 2021 12:47:35 +0000
Subject: [PATCH] email: Do not use an empty bytevector to test the charset.

Using an empty bytevector no longer throws an exception since Guile
commit 5ea8c69e9153a970952bf6f0b32c4fad6a28e839.

* email/email.scm (post-process-content-transfer-encoding): Use a
bytevector of unit length to test the charset validity.

Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
---
 email/email.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/email/email.scm b/email/email.scm
index 3f4e194..fc1564e 100644
--- a/email/email.scm
+++ b/email/email.scm
@@ -832,7 +832,7 @@ values. The returned headers is a string and body is a bytevector."
   (define (valid-charset? charset)
     (catch #t
       (lambda ()
-        (bytevector->string (make-bytevector 0 0) charset)
+        (bytevector->string (make-bytevector 1 0) charset)
         #t)
       (const #f)))
 
-- 
2.33.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 524 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix tests with Guile 3.0.7
  2021-10-01 19:58 ` Arun Isaac
@ 2021-10-06  8:58   ` Arun Isaac
  0 siblings, 0 replies; 3+ messages in thread
From: Arun Isaac @ 2021-10-06  8:58 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: guile-email

[-- Attachment #1: Type: text/plain, Size: 146 bytes --]


Hi Mathieu,

I applied the patch, and added your name to the new Contributors section
on https://guile-email.systemreboot.net/

Thanks! :-)
Arun

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 524 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-06  8:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 12:53 Fix tests with Guile 3.0.7 Mathieu Othacehe
2021-10-01 19:58 ` Arun Isaac
2021-10-06  8:58   ` Arun Isaac

guile-email discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lists.systemreboot.net/guile-email/0 guile-email/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-email guile-email/ http://lists.systemreboot.net/guile-email \
		guile-email@systemreboot.net
	public-inbox-index guile-email

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git