Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Nov 2008 00:46:12 -0500
From:      Eitan Adler <eitanadlerlist@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: `type' built-in command in /bin/sh
Message-ID:  <492E3424.4080109@gmail.com>
In-Reply-To: <20081124084016.GA1384@lizard.fafoe.narf.at>
References:  <87vdueavft.fsf@h1.lan> <20081124084016.GA1384@lizard.fafoe.narf.at>

next in thread | previous in thread | raw e-mail | index | archive | help
-----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-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?492E3424.4080109>