🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
3 messages
3 total messages Started by Heikki Kantola Thu, 18 Feb 1999 00:00
Slrn and B-encoded headers?
#46594
Author: Heikki Kantola
Date: Thu, 18 Feb 1999 00:00
15 lines
1352 bytes
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.
-- 
Heikki "Hezu" Kantola, <Heikki.Kantola@IKI.FI>
L�hett�m�ll� mainoksia tai muuta asiatonta s�hk�postia yll� olevaan
osoitteeseen sitoudut maksamaan oikolukupalvelusta FIM500 alkavalta
tunnilta.

Re: Slrn and B-encoded headers?
#46608
Author: Hubert Figuiere
Date: Thu, 18 Feb 1999 00:00
38 lines
1785 bytes
I just posted:

>(by rereading this afterwards, I find that I can do better for
>this code... I'll redo the patch I think.)

Here is the new patch :-)

<<<BEGIN
--- ../../slrn/src/mime.c	Thu Nov  5 19:05:14 1998
+++ mime.c	Thu Feb 18 14:19:28 1999
@@ -346,7 +347,13 @@
    while (src + 3 < srcmax)
      {
 	*dest++ = (BASE64(src[0]) << 2) | (BASE64(src[1]) >> 4);
+       if (src[2] == '=') {
+           break;
+       }
 	*dest++ = ((BASE64(src[1]) & 0xf) << 4) | (BASE64(src[2]) >> 2);
+       if (src[3] == '=') {
+           break;
+       }
 	*dest++ = ((BASE64(src[2]) & 0x3) << 6) | BASE64(src[3]);
 	src += 4;
      }

<<<END

Far much cleaner now :=)


Hub
-- 
> Je souhaiterais essayer Internet Explorer 4.0 sous Linux.
> Il existe 2 versions: une sous HP/UX et une sous Solaris
> Laquelle dois je utiliser?
-+- MJM in Guide du linuxien pervers : "Choisir son environnement" -+-

Re: Slrn and B-encoded headers?
#46610
Author: Hubert Figuiere
Date: Thu, 18 Feb 1999 00:00
67 lines
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"

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads