Article View: news.software.readers
Article #46610Re: Slrn and B-encoded headers?
From: Hubert Figuiere
Date: Thu, 18 Feb 1999 00:00
Date: Thu, 18 Feb 1999 00:00
67 lines
3112 bytes
3112 bytes
In article <slrn7cnskv.onr.hezu@tuuri.ling.helsinki.fi>, Heikki Kantola wrote:
>I think there's a "feature" in Slrn's B-encoded[1] header decoding code
>as it seems that Slrn adds extraneous �'s (that's y diaresis, Latin 1
>char number xFF) at the end of each word. Of course, one solution to
>fix that problem would be getting of stupid news readers which use that
>unreadable encoding instead of bit more readable Q-encoding in first
>place, but I guess that's impossible...
>
>[1] as defined by RFC 2047.
This is IMHO a slrn bug in Base64 headers decoding : it does NOT
ignore the padding '=' at the end of the Base64 encoded data,
thus producing those extraneous chars. I have sent a patch to JED
for integration in future release (no answer since, I don't know
the status of this).
I put here the patch...Apply with patch -p0 in 'slrn/src/'
<<<BEGIN
*** ../../slrn/src/mime.c Thu Nov 5 19:05:14 1998
--- mime.c Mon Dec 7 14:25:55 1998
***************
*** 346,353 ****
while (src + 3 < srcmax)
{
*dest++ = (BASE64(src[0]) << 2) | (BASE64(src[1]) >> 4);
! *dest++ = ((BASE64(src[1]) & 0xf) << 4) | (BASE64(src[2]) >> 2);
! *dest++ = ((BASE64(src[2]) & 0x3) << 6) | BASE64(src[3]);
src += 4;
}
return dest;
--- 347,364 ----
while (src + 3 < srcmax)
{
*dest++ = (BASE64(src[0]) << 2) | (BASE64(src[1]) >> 4);
! if (src[2] != '=') {
! *dest++ = ((BASE64(src[1]) & 0xf) << 4) | (BASE64(src[2]) >> 2);
! if (src[3] != '=') {
! *dest++ = ((BASE64(src[2]) & 0x3) << 6) | BASE64(src[3]);
! }
! else {
! break;
! }
! }
! else {
! break;
! }
src += 4;
}
return dest;
<<<END
(by rereading this afterwards, I find that I can do better for
this code... I'll redo the patch I think.)
Hope this helps.
Hub
--
�Ca te derange ??? Je fait ce que je veut si ca te plait pas tu vas
ailleurs gros c,, Mis a part ca si quelqun voulait bien me repondre
ce serais sympa.�
TOTO in Guide du linuxien pervers : "Bien pr�parer sa repartie"
Technical Details
Message-ID:
<slrn7co4is.e0q.hfiguiere@dirkpitt.solsoft.fr>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<slrn7cnskv.onr.hezu@tuuri.ling.helsinki.fi>Show Full Headers
Complete Article Headers
Message-ID: <slrn7co4is.e0q.hfiguiere@dirkpitt.solsoft.fr> Subject: Re: Slrn and B-encoded headers? Date: Thu, 18 Feb 1999 00:00:00 +0000 From: hfiguiere@teaser.fr (Hubert Figuiere) References: <slrn7cnskv.onr.hezu@tuuri.ling.helsinki.fi> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 445682285 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: usenet@itesec.hsc.fr X-Trace: itesec.hsc.fr 919343708 22891 192.70.106.209 (18 Feb 1999 13:15:08 GMT) Organization: none Mime-Version: 1.0 User-Agent: slrn/0.9.5.4noqp-ext[hub-PL4] (UNIX) Reply-To: hfiguiere@teaser.fr NNTP-Posting-Date: 18 Feb 1999 13:15:08 GMT Newsgroups: news.software.readers