This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: [1.7] bug in chdir
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 15 Jul 2009 10:46:35 +0200
- Subject: Re: [1.7] bug in chdir
- References: <loom.20090714T213944-461@post.gmane.org>
- Reply-to: cygwin at cygwin dot com
On Jul 14 21:47, Eric Blake wrote:
> $ ls //home
> ls: reading directory //home: No such file or directory
> $ # makes sense; I don't have a remote machine named home
> $ cd //home
> $ # huh? no error reported?
> $ /bin/pwd # avoid shortcuts in bash builtin; /bin/pwd uses getcwd
> //home
Sorry Eric, but I can't reproduce this. I tried it on XP and 2K8R2
with identical result.
That's what I get in bash:
corinna@cathi ~
$ ls //home
ls: cannot access //home: No such file or directory
corinna@cathi ~
$ cd //home
bash: cd: //home: No such file or directory
corinna@cathi ~
$
And that's what I get in dash:
$ ls //home
ls: cannot access //home: No such file or directory
$ cd //home
cd: 2: can't cd to //home
$
> $ dash -c 'CDPATH=/; cd home'
> //home
On my systems this result in:
$ dash -c 'CDPATH=/; cd home'
cd: 1: can't cd to home
I also tried a simple test application which removes the shell
magic from the picture:
#include <stdio.h>
int
main (int argc, char **argv)
{
int ret = 0;
if (argc > 1)
ret = chdir (argv[1]);
if (ret)
perror ("chdir");
return 0;
}
$ gcc -g -o chdir chdir.c
$ ./chdir //home
chdir: No such file or directory
$
If you're able to cd to //home, then there must be some crucial
difference in your environment. You should debug this, at least with
strace, so we can find out under what circumstances this occurs.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple