GNU bug report logs - #19240
cut 8.22 adds newline

Previous Next

Package: coreutils;

Reported by: John Kendall <john <at> capps.com>

Date: Mon, 1 Dec 2014 16:44:01 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


Message #54 received at 19240 <at> debbugs.gnu.org (full text, mbox):

From: Bob Proulx <bob <at> proulx.com>
To: John Kendall <john <at> capps.com>, 19240 <at> debbugs.gnu.org
Subject: Re: bug#19240: cut 8.22 adds newline
Date: Thu, 4 Dec 2014 14:55:03 -0700
Eric Blake wrote:
> Be careful; the POSIX specification of '%.30s' does NOT work well with
> multibyte characters; it is specified as:
> ...
> which means that it CAN and WILL corrupt output if the number of bytes
> written falls in the middle of a multi-byte character.

Good point.  Which leads me back to thinking that printing a tag first
and then the filename second and letting it be as long as it needs to
be without truncation is the best solution.

But of course in the original application coming from a legacy
environment the file names would never be multibyte.

Bob




This bug report was last modified 10 years and 171 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.