This is the mail archive of the
mailing list for the Cygwin project.
Re: Patch to allow trailing dots on managed mounts
On Dec 19 21:57, Pierre A. Humblet wrote:
> At 09:44 PM 12/18/2004 -0500, Christopher Faylor wrote:
> >For now, I'm disallowing all use of '.\' and ' \' in a path. It seems
> >more consistent to disallow everything than to allow some stuff. I
> >didn't change the symlink code to disallow "ln -s foo bar..." If someone
> >actually complains about this, maybe I will.
> >So, "ls /bin........." works, "ls /bin./pwd.exe" doesn't work and "ls
> >/cygwin/c/cygwin/bin./pwd.exe" doesn't work either. Nor does
> >"ls c:\cygwin\bin.\pwd.exe". I don't know if we'll hear complaints about
> >this one or not.
I guess we will. The trailing dots are not removed from the POSIX path
in case of chdir, but the chdir itself succeeds. That leads to an
$ cd /bin...
/bin... <- This was printed as /bin before
$ ls sh.exe
ls: sh.exe: No such file or directory
In terms of consistancy it should be impossible to chdir already,
> Do you intent to remove the dot checking code in normalize_xxx_path?
> It now seems to be useless and even counterproductive.
AFAICS, this code could go.
> >>Also, for my info, what is the unc\ in
> >> !strncasematch (this->path + 4, "unc\\", 4)))
> >>around line 868? I have never seen that documented.
> \\.\unc\computer\share indicates a remote share. So apparently the intention
> was to add a final \ in that case, but not on \\.\c: (according to the
> comment) nor on \\.\c:\somedir (why not??), and never with PC_FULL.
> Is there ever any reason to add a \ to a Windows path?
> Now, I checked (on XP Home) that "dir \\.\c:" does NOT work, while "dir \\.\c:\"
> does work, which seems to contradict the intention in the comment.
This is really old stuff. The original intend was not to append the
backslash because otherwise Cygwin failed to open raw devices and tapes
using the \\.\X: or \\.\tapeN syntax. This has long gone now and there
should be really no reason anymore to special case that.
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader mailto:firstname.lastname@example.org
Red Hat, Inc.