Re: Flowed text



On 2001.08.30 11:15 Jules Bean wrote:
> On Thu, Aug 30, 2001 at 10:38:47AM -0400, Peter Bloomfield wrote:
>> RFC 2646 (http://www.imc.org/rfc2646 -- thank you, Brian, for the
> pointer!):
> 
> Brain is the RFC-man ;-)
> 
> (Typo in his name was accidental, but somehow appropriate here, so
> I'll leave it!)
> 
> I haven't tried the patch yet, but I applaud the idea noisily!
> 
>> The code works in minimal tests (this message, for instance, has 
>> `format=flowed'), but is presumably full of flaws. The wrapping 
>> code
> 
> Well, your wrap length is definitely too long: was it 80?  Try 72 or
> so.
> 
> Jules

Thanks for focusing my attention on that! It had been bothering me, 
but I didn't check it.

The wrap length was in fact set to 72--but the line length wasn't 
calculated correctly! Flunk on `Loops 101'--correction below.

The current code also eats leading whitespace--more on that later.

Peter
____________________________________________

diff -u libbalsa/misc.c.orig libbalsa/misc.c
--- libbalsa/misc.c.orig	Thu Aug 30 17:58:38 2001
+++ libbalsa/misc.c	Thu Aug 30 17:51:09 2001
@@ -481,8 +481,10 @@
		}
		if (!*str)
		    break;	/* and append '\n', then get the next 
line */
-		while (*str && !isspace(*str++) && len < MAX_WIDTH)
+		while (*str && !isspace(*str) && len < MAX_WIDTH) {
		    len++;
+		    str++;
+		}
		/*
		 * remember where the non-whitespace part of this word
		 * ended--this is where the line effectively ends, if




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