nmh-workers
[Top][All Lists]
Advanced

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

Re: [Nmh-workers] Thoughts: header/address parsing


From: Ken Hornstein
Subject: Re: [Nmh-workers] Thoughts: header/address parsing
Date: Sun, 24 Aug 2014 23:29:57 -0400

>
>> 1) Instead of callers allocating the space for the fmt_scan()
>>    output, have fmt_scan() do it.  Callers would pass a **char
>>    instead of a char array and be responsible for free'ing the
>>    space when they're done.
>>
>> 2) fmt_scan() would use some function of width as the initial
>>    size of the space and realloc by 2X as needed.
>
>Done, though I wrapped the char** in a new charstring_t type.
>It keeps track of the character count, accounting for multibyte
>characters.

I looked at that those changes; it all looks great!

>Ken, I removed -bufsize from fmttest because it no longer did
>anything.

Yeah, that made sense.

>> 3) To not break existing user scripts, width would continue to
>>    include the trailing newline.  Add support for an optional
>>    profile setting to not include the trailing newline.
>
>I don't think we ever resolved how to handle this:  wcwidth()
>returns -1 for the width of newlines, and other non-printable
>characters.  And the profile setting idea didn't fly.  And I
>don't know if it's worth adding another switch just to not count
>the newline.

So ... what would break if the newline _wasn't_ counted?  I am leaning
towards going the wcwidth() route and simply not counting things like that
as printable.  I will note that isprint('\n') returns 0.

--Ken



reply via email to

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