bug-coreutils
[Top][All Lists]
Advanced

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

Re: nl-command bug


From: Eric Blake
Subject: Re: nl-command bug
Date: Sat, 03 Dec 2005 14:29:40 -0700
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Silvano Catinella on 12/1/2005 7:39 AM:
> Hello,
> 
> I have discovered a little bug in nl command written by  Scott Bartram and
> David MacKenzie. When I push an ASCII-color-text into the pipe used by nl, I
> can see a very strange behavior.

The behavior is admittedly strange, but it is not a bug.  The last line
with escape codes is not empty even though the escape codes don't show up
visibly on the terminal.  In general, piping terminal escape sequences to
other programs leads to surprising results; hence it is usually better to
use ls --color=auto instead of --color=always, so that you only get
terminal escape sequences when writing directly to a terminal.

> 
> I have written a new version of nl command, please find the source-file as
> attach.

Thanks for your ideas, and for sending a patch.  However, your attachment
was sent with MIME type application/octet-stream, even though it is a text
file.  Please consider using options to your email client to send text
attachments as text.

Furthermore, your file is a complete rewrite of nl.  It would be much
easier if you were to provide patches against the existing version of nl,
rather than writing it from scratch in a new coding style.  It was
practically impossible to diff your version with the current coreutils
version.

> 
> In my version I have add a feature to setting the record-separator string. I
> have no yet implemented the regexp on flag -b, but if you consider my
> contribute useful, I will happy to complete this task.

Your version violated several GNU coding standards, such as using //
comments (although CVS coreutils now requires C99 compilers, we still try
to stick to C89 rules where only /**/ comments exist), or trying to create
short options named -rs or -nz (short options, by definition, are a single
letter).  I did not review much further than that, due to the fact that
your file was so different from the existing coreutils/src/nl.c.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDkg5D84KuGfSFAYARAmG+AJ9/jq7sfiLclntRSbu7yCG61BCrMgCglvvP
Ez+V/aMH8tL5T/c2BSXN1vc=
=j+Gp
-----END PGP SIGNATURE-----




reply via email to

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