public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Sami Kerola <kerolasa@iki.fi>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] wall: wrap message header when it exceeds 79 characters
Date: Tue, 29 Jul 2014 09:44:08 +0200	[thread overview]
Message-ID: <20140729074408.GO8533@x2.net.home> (raw)
In-Reply-To: <1406487666-19466-1-git-send-email-kerolasa@iki.fi>

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++)...

    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2014-07-29  7:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-27 19:01 [PATCH] wall: wrap message header when it exceeds 79 characters Sami Kerola
2014-07-29  7:44 ` Karel Zak [this message]
2014-07-29  8:27   ` Sami Kerola
2014-07-29 16:00   ` Dale R. Worley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140729074408.GO8533@x2.net.home \
    --to=kzak@redhat.com \
    --cc=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox