[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nl-command bug
Re: nl-command bug
Sat, 03 Dec 2005 14:29:40 -0700
Mozilla Thunderbird 1.0.2 (Windows/20050317)
-----BEGIN PGP SIGNED MESSAGE-----
According to Silvano Catinella on 12/1/2005 7:39 AM:
> 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
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
> 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
-----END PGP SIGNATURE-----