GNU bug report logs - #7085
fmt (GNU coreutils) 6.10

Previous Next

Package: coreutils;

Reported by: "Denis M. Wilson" <dmw <at> oxytropis.plus.com>

Date: Wed, 22 Sep 2010 20:23:01 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: "Denis M. Wilson" <dmw <at> oxytropis.plus.com>
Cc: 7085 <at> debbugs.gnu.org
Subject: bug#7085: fmt (GNU coreutils) 6.10
Date: Wed, 22 Sep 2010 15:08:01 -0600
On 09/22/2010 01:59 PM, Denis M. Wilson wrote:
> This program does not deal properly with CRLF terminators.
> Gratuitous CRs are left in joined lines; they should be
> removed. The user may want to keep the CRLF style or change
> to Unix (LF). There should be an option for this.

Thanks for the report.

POSIX is clear that CR is data and not a line terminator, so the 
existing behavior (in the absence of any new command-line option) is 
correct.

Now, we have a philosphy question - is it better to teach fmt a new 
command line option, and then have to wait for a new enough coreutils 
installation to propagate to various machines where you plan on using 
that extension, or is it better to use existing tools that are already 
portable according to POSIX and do the job now?  If you answered this 
question the same as me, then a solution that works now is favorable, so 
it becomes a question of massaging your files to get rid of the CR 
characters prior to using fmt on the file.  Something as simple as:

tr -d '\r' < file > file.out && mv file.out file

will do the trick.  Other common wrappers, like dos2unix, exist to make 
this sanitization process even easier.  So, I'm reluctant to add such a 
feature myself, and it will take some pretty strong arguments (such as 
existing practice in other fmt implementations) to convince me that a 
new option is worthwhile.

Meanwhile, you may want to consider upgrading to a newer coreutils; the 
latest stable version is 8.5, with a number of bug fixes in various tools.

-- 
Eric Blake   eblake <at> redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




This bug report was last modified 13 years and 308 days ago.

Previous Next


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