summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2020-03-18 01:36:38 -0600
committerEduardo Chappa <chappa@washington.edu>2020-03-18 01:36:38 -0600
commit277d70d881a99e563cfa1c4eee4cc0e77c17ea7d (patch)
tree8abbae9716c658e0f9e17c2093b556319e1b3f98
parentd7838fd7545719029474fea04a51332a542e978a (diff)
downloadalpine-277d70d881a99e563cfa1c4eee4cc0e77c17ea7d.tar.xz
* Fixes to documentation provided by Dennis Davis.
* Bug that makes Alpine split encoded words in the subkect of a message in the middle of a utf-8 character into two encoded words, breaking the encoding. Reported by Jean Chevalier.
-rw-r--r--pith/charset.c29
-rw-r--r--pith/pine.hlp22
2 files changed, 37 insertions, 14 deletions
diff --git a/pith/charset.c b/pith/charset.c
index f651abe9..b3d44d42 100644
--- a/pith/charset.c
+++ b/pith/charset.c
@@ -593,9 +593,32 @@ rfc1522_encoded_word(unsigned char *s, int enc, char *charset)
for(goal = ((goal / 4) * 3) - 2; goal && *s; goal--, s++)
;
else /* special 'Q' encoding */
- for(; goal && *s; s++)
- if((goal -= RFC1522_ENC_CHAR(*s) ? 3 : 1) < 0)
- break;
+ if(!strucmp(charset, "UTF-8")){ /* special handling for utf-8 */
+ int i,more;
+ unsigned char *p;
+ for(; goal && *s; s++){
+ more = *s < 0x80 ? 0
+ : *s < 0xe0 ? 1
+ : *s < 0xf0 ? 2
+ : *s < 0xf8 ? 3
+ : *s < 0xfc ? 4
+ : *s < 0xfe ? 5 : -1;
+ if(more >= 0){ /* check that we have at least more characters */
+ for(p = s, i = 0; i <= more && *p != '\0'; i++, p++)
+ goal -= RFC1522_ENC_CHAR(*p) ? 3 : 1;
+ if(goal < 0) /* does not fit in encoded word */
+ break;
+ s += i - 1; /* i - 1 should be equal to more */
+ }
+ else /* encode it, and skip it */
+ if((goal -= RFC1522_ENC_CHAR(*s) ? 3 : 1) < 0)
+ break;
+ }
+ }
+ else
+ for(; goal && *s; s++)
+ if((goal -= RFC1522_ENC_CHAR(*s) ? 3 : 1) < 0)
+ break;
return(s);
}
diff --git a/pith/pine.hlp b/pith/pine.hlp
index fdb24c3f..3a358fbd 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 411 2020-02-29 14:37:03
+Alpine Commit 412 2020-03-18 01:36:29
============= h_news =================
<HTML>
<HEAD>
@@ -174,9 +174,8 @@ Apache web server.
<H2>New in Alpine <!--#echo var="ALPINE_VERSION"--> (<!--#echo var="ALPINE_REVISION"-->)</H2>
This is a development version of Alpine. These enhancements are
-released after the release of version
-<!--#echo var="ALPINE_VERSION"--> (<!--#echo var="ALPINE_REVISION"-->). Please report
-any problems you find with this release.
+released after the release of version 2.22. Please report any
+problems you find with this release.
<P> Additions include:
@@ -197,22 +196,23 @@ any problems you find with this release.
<LI> New variable system-certs-file that allows users to configure the
location of a container of certificate authority (CA) certificates
to be used to validate certificates of remote servers.
-
-<LI>Crash in Alpine when attempting to reply to a multipart/alternative
- message that is malformed, and the option to include attachments in
- reply is enabled. Reported and patched by Peter Tirsek.
</UL>
-<P> Bug fixes include
+<P>
+Bugs that have been addressed include:
<UL>
<LI>Bug in PC-Alpine that made Alpine go into an infinite loop and
consume CPU when it was iconized. Reported by Holger Schieferdecker in
comp.mail.pine.
+
+<LI>Crash in Alpine when attempting to reply to a multipart/alternative
+ message that is malformed, and the option to include attachments in
+ reply is enabled. Reported and patched by Peter Tirsek.
</UL>
<P>
-Version <!--#echo var="ALPINE_VERSION"--> (<!--#echo var="ALPINE_REVISION"-->)
-addresses bugs found in previous releases and has a few additions as well.
+Version 2.22 addresses bugs found in previous releases and has several
+additions as well.
<P>
Additions include: