Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Sat, 25 Oct 2003 21:41:26 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com Subject: Re: 1.5.1: can't open files beginning with "..." In-Reply-To: <20031025221849.GQ1653@cygbert.vinschen.de> Message-ID: References: <16281 DOT 6930 DOT 564000 DOT 468376 AT gargle DOT gargle DOT HOWL> <20031025165210 DOT GM1653 AT cygbert DOT vinschen DOT de> <20031025221849 DOT GQ1653 AT cygbert DOT vinschen DOT de> Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sun, 26 Oct 2003, Corinna Vinschen wrote: > On Sat, Oct 25, 2003 at 10:58:10PM +0200, Pavel Tsekov wrote: > > > On Sat, 25 Oct 2003, Corinna Vinschen wrote: > > > > > On Sat, Oct 25, 2003 at 12:04:14AM +0200, Pavel Tsekov wrote: > > > > > Chris Moore wrote: > > > > > > I have a file on my PC called "...foo.txt". > > > > > > > > This does work, but Cygwin's path handling code understands > > > > only ".." and "." . If it get three dots in a raw and they > > > > appear before the last '/' char, Cygwin returns ENOENT. > > > > > > Fixed in CVS now. > > > > Does it fix the following: > > > > Administrator AT mordor ~ > > $ cd /usr/bin../ > > No, it fixes the more than two leading dots problem. The above is > a genuin windows problem as you noted in your previous mail. I don't > know how to fix this without noticeably slowing down the path conv > routine. > > Corinna That's what managed mode would be perfect for. It would need something like the patch below: Index: winsup/cygwin/path.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/path.cc,v retrieving revision 1.277 diff -u -p -r1.277 path.cc --- winsup/cygwin/path.cc 25 Oct 2003 16:12:45 -0000 1.277 +++ winsup/cygwin/path.cc 26 Oct 2003 01:35:16 -0000 @@ -1178,6 +1178,11 @@ special_name (const char *s, int inc = 1 if (strpbrk (s, special_chars)) return !strncasematch (s, "%2f", 3); + if (strcasematch (s, ".") || strcasematch (s, "..")) + return false; + if (s[strlen (s)-1] == '.') + return -1; + const char *p; if (strcasematch (s, "conin$") || strcasematch (s, "conout$")) return -1; -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "I have since come to realize that being between your mentor and his route to the bathroom is a major career booster." -- Patrick Naughton -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/