nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inc and non-compliant long lines redux


From: Ken Hornstein
Subject: Re: inc and non-compliant long lines redux
Date: Wed, 16 Nov 2022 09:52:32 -0500

>> The only complicated thing  I see is dealing with the  case where a CR
>> is at  the end of one  buffer and the LF  is at the start  of the next
>> buffer; I think that is straightforward.
>
>Precisely. Though in  my current patch proposal, the  problem isn't with
>CR/LF but  with the two  .. signal terminator  coming from POP.  The two
>dots must be getting  split and the first dot is at the  end of a buffer
>and the second is at the beginning of the next buffer.

Yeah, I was realizing this.  I think the logic has to be something like:

- netsec_read() into buffer 'b';

- Loop over 'b':

  If ! CR && ! LF
     putc()

  If CR
     check to see if next character is LF.  If it is, skip over CR.
     If it is not, output CR.  If at the end of the buffer, read
     more and restart loop.

  If LF
     If at the end of buffer, read more and loop back to top.

     Output LF.  If the next character is ".", make sure not at end of
     buffer (must have at least two more characters).  If are, read more
     and loop back to top.

     If the next character is "." and the characters AFTER "." is not
     CR-LF, skip over ".".  If the next characters ARE ". CR LF", then
     terminate multiline response.

I ... think that's correct?

--Ken



reply via email to

[Prev in Thread] Current Thread [Next in Thread]