delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/03/05/12:21:06

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 5 Mar 2010 18:20:48 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [ANNOUNCEMENT] [1.7] Updated: dash-0.5.5.1-2; Obsolete: ash
Message-ID: <20100305172048.GN7980@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <announce DOT 4A5C7A2B DOT 4020700 AT byu DOT net> <4B5860C9 DOT 50100 AT sidefx DOT com> <4B591221 DOT 10501 AT byu DOT net> <4B91105B DOT 7050205 AT sidefx DOT com> <20100305152637 DOT GK7980 AT calimero DOT vinschen DOT de> <4B913788 DOT 40301 AT sidefx DOT com> <4B913AF2 DOT 3070102 AT redhat DOT com>
MIME-Version: 1.0
In-Reply-To: <4B913AF2.3070102@redhat.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
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 Mar  5 10:10, Eric Blake wrote:
> According to Edward Lam on 3/5/2010 9:55 AM:
> > Corinna Vinschen wrote:
> >> Is that a case-sensitivity issue, perhaps?  See
> >> http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-casesensitive
> >>
> > 
> > I don't see how it is:
> > 
> > $ dash
> > $ cd /c
> > $ ls -d W*
> > WINDOWS
> > $ cd c:/WINDOWS
> > cd: 3: can't cd to c:/WINDOWS
> 
> Let's rule out bash vs. dash complexities, and first focus on whether
> cygwin1.dll might be at fault.  Untested code:
> 
> #include <unistd.h>
> #include <stdio.h>
> #include <string.h>
> #include <errno.h>
> int main(int argc, char**argv)
> {
>   int e = chdir(argv[1]);
>   char *cwd = getcwd(NULL,0);
>   return printf ("chdir to %s: %d(%s), now in %s\n", argv[1],
>     e, strerror(e), cwd);
> }

Works fine in Cygwin, I just tested it:

  # cat > chdir.c << EOF
  #include <stdio.h>
  #include <limits.h>

  int
  main (int argc, char **argv)
  {
    int ret = 0;
    if (argc > 1)
      ret = chdir (argv[1]);
    if (ret)
      perror ("chdir");
    else
      {
	char buf[PATH_MAX];
	getcwd (buf, PATH_MAX);
	printf ("pwd: %s\n", buf);
      }
    return ret ? 1 : 0;
  }
  EOF
  $ gcc -g -o chdir chdir.c
  $ ./chdir C:/Windows
  pwd: /cygdrive/c/Windows

It's a problem in dash apparently.  Btw., tcsh also has a problem
with DOS paths, if you use backslashes, see the prompt:

  [~]$ cd C:\\Windows
  [~/C:\Windows]$ pwd
  /cygdrive/c/Windows

I just don't care enough for DOS paths so I won't fix.


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