bug-coreutils
[Top][All Lists]
Advanced

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

Re: limited --width argument for fmt


From: Philip Rowlands
Subject: Re: limited --width argument for fmt
Date: Wed, 12 Jul 2006 02:55:45 +0100 (BST)

On Tue, 11 Jul 2006, Behdad Esfahbod wrote:

This a bug report against fmt.

address@hidden test]$ fmt -w 12345
fmt: invalid width: `12345'


What I'm trying to achieve here is to unwrap lines, aka "tr '\n' ' '"
but using fmt.  According to GNU Coding Standards, GNU tools should not
have hard limits on the size of input or parameters when it doesn't make
sense...

You're quite right, fmt doesn't meet the "no arbitrary limits" goal in this respect. This comment is found in the current code:

/* Size of paragraph buffer, in words and characters.  Longer paragraphs
   are handled neatly (cf. flush_paragraph()), so long as these values
   are considerably greater than required by the width.  These values
   cannot be extended indefinitely: doing so would run into size limits
   and/or cause more overflows in cost calculations.  FIXME: Remove these
   arbitrary limits.  */

#define MAXWORDS        1000
#define MAXCHARS        5000

The longest line that fmt will handle is half of MAXCHARS. As you've demonstrated, there are other ways to achieve the same effect with long lines, so it's difficult to say if or when someone will prioritise fixing the limitation.


Cheers,
Phil




reply via email to

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