X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 15 Jul 2009 10:46:35 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: [1.7] bug in chdir Message-ID: <20090715084635.GQ27613@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-02-20) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list 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 AT cathi ~ $ ls //home ls: cannot access //home: No such file or directory corinna AT cathi ~ $ cd //home bash: cd: //home: No such file or directory corinna AT 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 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