Mail Archives: cygwin/2010/03/05/12:21:06
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 -