🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #49992

slrn 0.9.5.2: duplicated periods in post.c

#49992
From: Sherilyn
Date: Tue, 20 Jul 1999 00:00
105 lines
3961 bytes
-----BEGIN PGP SIGNED MESSAGE-----


To sign my postings with PGP, I have written a macro based on the
post-file-hook example shipped with slrn 0,9.5.2.  It simply splits
the posting into header and body sections, stripping the sig at "--",
PGP-signs the body, and then reconstructs the posting file from the
header, body and signature file.

It's just come to my notice that the postings output are sometimes
corrupted, and upon examining one such posting I notice that it is
because, when I type an ellipsis ("...") on its own on a blank line,
which is how I habitually represent a snip in quoted text in a followup,
slrn in posting it always adds an extra "." if it finds a "." in the
first character position in the line, thereby busting my PGP armor.

Here's the relevant code fragment from post.c, around line 900 in
my copy:

Before:  ? represents "don't care".
    line[]
     012345...
    [?.?????????????????????]
      ^
      |
      linep

Code fragment:
        if (*linep == '.')
          {
             linep--;
             *linep = '.';
          }

After:
    line[]
     012345...
    [..?????????????????????]
     ^
     |
     linep
   

'linep' is the pointer to the first character in a line, which is
loaded into the buffer 'line' from the second character position onwards,
presumably so that the code can neatly add an extra period to the
beginning of the line by just "taking one step backwards" in the buffer
in this way and saving itself a memmove() call.

I deduce that this code is written as it is because a lone period
will be interpreted as the end of the posting--and indeed I notice
that the nntp_end_post() function in nntplib.c signals the end of
a posting by sending a line containing a single period.

Cautiously, I'd suggest that the duplication of a period except where it
is absolutely necessary represents an undesirable feature in slrn.  The
code could be rewritten as:

        if (*linep == '.' && !linep[1]) /* lone period on line */
          {
             linep--;
             *linep = '.';
          }

Thus the code would only alter the posted output if absolutely necessary.

Of course, for the purposes of my macro, I have to ensure that my
filter pre-empts John's treatment of the single period case, but
with the code as it is I see no workaround since even if I add an extra
period to a line containing a single period, John's code will add a
further period, busting the armor again.

Slrn Version: 0.9.5.2 (Feb 17 1999 21:46:36)
S-Lang Library Version: 1.2.2
OS-Type: Unix

slrn compiled with support for:
        character set mapping
        nntp (SLtcp socket code)
        spool
        inews
        slrnpull
        S-Lang Macros

Default server object: nntp
Default posting mechanism: nntp
Supported character sets include:
        ISOLatin
        ibm850
        NeXT
Default character set: isolatin

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBN5T/xNSR8rI01qX9AQHscQQAho/MMtD+qUeQJK7axsxwUtHLFBZN36Uv
vXCBZqdzUs7BGdG8hv46jZECgDdo53AslY9d2GRdBLXLWmJtn9EDeUbxKyDnED6y
TzuLWXe5Hwd5bzP+RaYJoTfvW8A8/QWyEZ9lXeC+Oszjs70SGUBy1X8HVwFYGLrQ
hPPHZOiw4Uk=
=WbO2
-----END PGP SIGNATURE-----
-- 
Sherilyn

Technical Details
Message-ID: <slrn7p9vts.5sh.Sherilyn@sidaway.demon.co.uk>
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

Show Full Headers
Complete Article Headers
Message-ID: <slrn7p9vts.5sh.Sherilyn@sidaway.demon.co.uk>
Subject: slrn 0.9.5.2: duplicated periods in post.c
Date: Tue, 20 Jul 1999 00:00:00 +0000
From: Sherilyn@sidaway.demon.co.uk (Sherilyn)
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: 503316752
X-NNTP-Posting-Host: sidaway.demon.co.uk:158.152.43.216
X-Trace: news.demon.co.uk 932512834 nnrp-09:16090 NO-IDENT sidaway.demon.co.uk:158.152.43.216
Newsgroups: news.software.readers
X-Complaints-To: abuse@demon.net