Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Dec 1998 15:54:14 -0600 (CST)
From:      Steve Price <sprice@hiwaay.net>
To:        Dag-Erling Smorgrav <des@flood.ping.uio.no>
Cc:        cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/usr.bin/w w.c
Message-ID:  <Pine.OSF.4.02.9812241540390.30429-100000@fly.HiWAAY.net>
In-Reply-To: <xzpr9tpxlyn.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On 24 Dec 1998, Dag-Erling Smorgrav wrote:

# Steve Price <steve@FreeBSD.ORG> writes:
# > steve       1998/12/24 10:20:58 PST
# > 
# >   Modified files:
# >     usr.bin/w            w.c 
# >   Log:
# >   Since argv is in scope, use argv[0] instead of __progname.
# 
# Is that correct? __progname is (AFAIK) guaranteed to always be the
# base name (without the directory part) - at least now that it is fixed
# for Elf programs - whereas argv[0] may or may not contain a directory
# part.

Userland applications shouldn't use __progname.  Besides in this
case we really don't care if the path is present or not.  All we
are looking for is something that looks like 'uptime'.  Of course
this is still broken if you do something bizarre like /bin-uptime/w
and expect w(1) semantics.  Then again the original version would
treat 'umm-w' as uptime(1) and 'my-uptime' as 'w'.  Not a perfect
solution either way but I think the way it stands now fits the
original intent and doesn't use variables that aren't intended
for use in userland.

-steve

# DES
# -- 
# Dag-Erling Smorgrav - des@flood.ping.uio.no
# 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.4.02.9812241540390.30429-100000>