Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Feb 1995 13:53:50 -0800
From:      David Greenman <davidg@Root.COM>
To:        Bruce Evans <bde@zeta.org.au>
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 
Message-ID:  <199502062153.NAA00528@corbin.Root.COM>
In-Reply-To: Your message of "Sun, 05 Feb 95 16:26:50 %2B1100." <199502050526.QAA09902@godzilla.zeta.org.au> 

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



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