🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: demon.ip.developers
Article #840

Re: This isn't Not_Gripe_Of_The_Month

#840
From: Graham E Kinns
Date: Sun, 28 Jul 1996 00:00
49 lines
2210 bytes
John Washington <john@wash.demon.co.uk> wrote:
>     Graham@grempc.demon.co.uk "Graham E Kinns" wrote:

>GK> You've missed the 'obvious' C bug - the scope of no_check_dot means it
>
>No I haven't.  That was precisely why I posted it, but I thought
>it was glaringly obvious!

Sorry ...

[...]

>So this would be split into 255 chars, and then a 'line' of
>".\n", causing the incorrect code to believe the mail was
>complete.

Yes, checked this myself, KA9Q does start sending back 500 responses 
to the rest of the lines of the mail.

>GK> One of the bits of code you clipped in that block also breaks incoming 
>GK> lines at 256 chars.
>
>If you mean line breaks (\n) are inserted, I disagree.
>If you mean 'buf' is 256 bytes, I agree.  A longer line
>requires multiple calls of recvline(), but is reassembled
>in the mail file successfully, with no spurious breaks.

As I read it:

    recvline (mp->s, p, sizeof (buf))
    ...
    has_newline = strchr (p, '\n');
    rip (p);
    ...
    fprintf (mp->data, "%s\n", p)

has_newline remembers whether a \n was present, rip() removes any \r\n
but fprintf() adds the \n regardless of has_newline.

I regularly receive mail from either mailtool or textedit under X 
which only has an \n at the end of a paragraph which is why I know it 
happens :)  I'd be wary of fixing this one in case it breaks other 
mailers/editors e.g. PCElm seems to cope OK with long lines but Ted 
doesn't cope too well with lines > 256 chrs when quoting such mail.

Cheers, Graham.
-- 
----[ Graham E. Kinns ]----==========----< Graham@grempc.demon.co.uk >----
Technical Details
Message-ID: <838588137snz.4950@grempc.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <838295414snz@wash.demon.co.uk> <838324205snz.4907@grempc.demon.co.uk> <838398667snz@wash.demon.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bb05,4dbda9f54d28df13
X-Google-Attributes: gid10bb05,public
From: Graham E Kinns <Graham@grempc.demon.co.uk>
Subject: Re: This isn't Not_Gripe_Of_The_Month
Date: 1996/07/28
Message-ID: <838588137snz.4950@grempc.demon.co.uk>
X-Deja-AN: 170712159
x-mail2news-path: grempc.demon.co.uk
x-nntp-posting-host: grempc.demon.co.uk
references: <838295414snz@wash.demon.co.uk> <838324205snz.4907@grempc.demon.co.uk> <838398667snz@wash.demon.co.uk>
organization: Home, N Yorks, UK
newsgroups: demon.ip.developers