delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/15/04:47:01

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 <corinna-cygwin AT cygwin DOT com>
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: <loom DOT 20090714T213944-461 AT post DOT gmane DOT org>
MIME-Version: 1.0
In-Reply-To: <loom.20090714T213944-461@post.gmane.org>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019