From owner-cvs-all Thu Dec 24 13:54:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA25299 for cvs-all-outgoing; Thu, 24 Dec 1998 13:54:34 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from mail.HiWAAY.net (fly.HiWAAY.net [208.147.154.56]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA25291; Thu, 24 Dec 1998 13:54:30 -0800 (PST) (envelope-from sprice@hiwaay.net) Received: from localhost (sprice@localhost) by mail.HiWAAY.net (8.9.1a/8.9.0) with SMTP id PAA15162; Thu, 24 Dec 1998 15:54:15 -0600 (CST) Date: Thu, 24 Dec 1998 15:54:14 -0600 (CST) From: Steve Price To: Dag-Erling Smorgrav cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/usr.bin/w w.c In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk On 24 Dec 1998, Dag-Erling Smorgrav wrote: # Steve Price 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