shell-init: error retrieving current directory

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Aug 22 14:12:00 GMT 2013


On Aug 22 21:48, nu774 wrote:
> Hi,
> 
> It seems that getcwd() of bash continues the following approach
> until it reaches /.
> 
> 1) readdir() on the parent directory.
> 2) for each dirent returned by readdir(), find the entry that
> matches the current dirctory (by comparing inode or something).
> 3) set parent dir as current, and continue from 1).
> 
> When you call getcwd() not under / (that is, C:/cygwin64), say
> /c/foo/bar (here I assume C drive is mounted on /c), step 2) will
> fail when current is /c, since readdir() on / doesn't return c as a
> dirent.
> 
> In short, getcwd() of bash doesn't work as expected in this
> situation, and if Cygwin's getcwd() implementation complies
> requirement by bash, HAVE_GETCWD should be enabled.
> As far as I can see, HAVE_GETCWD enabled bash.exe is working fine here.

Since our bash maintainer Eric is currently extremly busy, I took a stab
at it and created a new bash-4.1.11-2 64-bit package.  It picked up the
Cygwin getcwd and didn't have the reported problem in my quick test.

Please give it a try as soon as it hits your favorite mirror.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20130822/804dad86/attachment.sig>


More information about the Cygwin mailing list