Re: [PATCH] wall: wrap message header when it exceeds 79 characters

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

 



On 29 July 2014 08:44, Karel Zak <kzak@xxxxxxxxxx> wrote:
> On Sun, Jul 27, 2014 at 08:01:06PM +0100, Sami Kerola wrote:
>> Header truncation started to happen more often after commit
>> d81c30553f4fb49173d38f69edff4b0b67a18b65 that made the header to be
>> longer.
>
>  Well, I did the change to be compatible with wall from sysvinit. The
>  original (BSD) wall header format was
>
>   Broadcast Message from %s@%s
>            (%s) at %d:%02d ...
>
>  it means two lines.
>
>> +             len = strlen(lbuf);
>> +             for (i = 0; 0 < len; i++)
>> +                     len -= fprintf(fp, "%-*.*s\007\007\r\n", TERM_WIDTH, TERM_WIDTH,
>> +                                    lbuf + (i * TERM_WIDTH)) + 4;
>
>  Now you want to reintroduce the old behavior (more lines for the header),
>  but with a completely random split... I don't think it's a good idea.
>
>  If we don't want the sysvinit header then it would be better to
>  compose nice proper header than depend on for (i = 0; 0 < len;
>  i++)...

Sounds like the options are

1. change to header format
2. add to documentation header might not have always all information
if it is too long

After reading Karel's advice I am thinking the second option is more acceptable.
I will wait couple days before sending a patch just in case someone has opinion
in against or in favor of the option 2.

-- 
Sami Kerola
http://www.iki.fi/kerolasa/
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux