From owner-cvs-lib Mon Feb 6 13:54:17 1995 Return-Path: cvs-lib-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id NAA22747 for cvs-lib-outgoing; Mon, 6 Feb 1995 13:54:17 -0800 Received: from Root.COM (implode.Root.COM [198.145.90.1]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id NAA22729; Mon, 6 Feb 1995 13:54:01 -0800 Received: from corbin.Root.COM (corbin.Root.COM [198.145.90.18]) by Root.COM (8.6.8/8.6.5) with ESMTP id NAA27377; Mon, 6 Feb 1995 13:53:52 -0800 Received: from localhost (localhost [127.0.0.1]) by corbin.Root.COM (8.6.9/8.6.5) with SMTP id NAA00528; Mon, 6 Feb 1995 13:53:52 -0800 Message-Id: <199502062153.NAA00528@corbin.Root.COM> X-Authentication-Warning: corbin.Root.COM: Host localhost didn't use HELO protocol To: Bruce Evans cc: CVS-commiters@freefall.cdrom.com, cvs-lib@freefall.cdrom.com, phk@freefall.cdrom.com Subject: Re: cvs commit: src/lib/libc/gen getcwd.c In-reply-to: Your message of "Sun, 05 Feb 95 16:26:50 +1100." <199502050526.QAA09902@godzilla.zeta.org.au> From: David Greenman Reply-To: davidg@Root.COM Date: Mon, 06 Feb 1995 13:53:50 -0800 Sender: cvs-lib-owner@freebsd.org Precedence: bulk >> Modified: lib/libc/gen getcwd.c >> Log: >> A cute hack to speed up things by Keith: if getenv("PWD") is the same >> inode as ".", then just return that. I added a check so it must start with >> a '/'. > >I just thought of another problem. What if $PWD has symlinks in it, or >bizarreness such as `/bin/../tmp/../'? The old getpwd would canonicalize >the path. In fact, I sometimes rely on this: after `cd /sys', bash sets >$PWD to /sys, and I sometimes use "`/bin/pwd`" if I want the real directory >name. I pointed this out to Keith but he didn't seem to think it was something to be concerned about. I think it is, however, and I'm not too thrilled with the change going into CVS. It really is a gratuitous hack that shouldn't be made, IMO. -DG