`type' built-in command in /bin/sh
Eitan Adler
eitanadlerlist at gmail.com
Wed Nov 26 21:46:19 PST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Stefan Farfeleder wrote:
> On Mon, Nov 24, 2008 at 02:12:22AM +0300, Zajcev Evgeny wrote:
>> Hello there. I just hit into "problem" that built-in sh command type
>> outputs to stdout when error occurs. I mean it returns non-0 status,
>> but outputs to stdout! I think stderr has been made exactly for such
>> purposes and `type' should use it in case of error .. what do you
>> think?
As far as I could tell
if (cmd != TYPECMD_SMALLV)
out1str(": not found\n");
has to be changed to
if (cmd != TYPECMD_SMALLV)
out2str(": not found\n");
C is not my strongest language so please let me know if I am correct.
- --
Eitan Adler
GNU Key fingerptrint: 2E13 BC16 5F54 0FBD 62ED 42B6 B65F 24AB E9C2 CCD1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)
iEYEARECAAYFAkkuNCQACgkQtl8kq+nCzNGrGgCfZu5MHngEnMyQ5X+g1ZtKraJu
blsAn3xoReD4+mVYU5Agw3Ns5CyIIO+p
=0cXm
-----END PGP SIGNATURE-----
More information about the freebsd-hackers
mailing list