From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25651 invoked by alias); 7 Feb 2013 16:10:44 -0000 Received: (qmail 25575 invoked by uid 22791); 7 Feb 2013 16:10:41 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from Unknown (HELO moutng.kundenserver.de) (212.227.17.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Feb 2013 16:10:31 +0000 Received: from [127.0.0.1] (dslb-088-073-134-120.pools.arcor-ip.net [88.73.134.120]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0LlnDE-1UcXkt2BUW-00Zg29; Thu, 07 Feb 2013 17:10:23 +0100 Message-ID: <5113D1ED.20305@towo.net> Date: Thu, 07 Feb 2013 16:10:00 -0000 From: Thomas Wolff User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: stat() and tilde prefix (was bad bash tab completion) References: <5024B4D4.6080409@shaddybaddah.name> <50F395D5.4050201@shaddybaddah.name> <20130114061747.GB16739@ednor.casa.cgf.cx> <20130114100002.GA22039@calimero.vinschen.de> <50F417F9.8040108@shaddybaddah.name> <20130114161307.GB8617@calimero.vinschen.de> <50F54C93.9090702@shaddybaddah.name> <511350F3.8040702@shaddybaddah.name> <5113C886.9070904@redhat.com> In-Reply-To: <5113C886.9070904@redhat.com> X-TagToolbar-Keys: D20130207171021486 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2013-02/txt/msg00072.txt.bz2 Am 07.02.2013 16:30, schrieb Eric Blake: > ... > > ... > the fact that cygwin's handling of .. is not POSIX-compliant. I think a > better fix would be to change file_exists() itself instead of adding a > misnamed wrapper function; then bashline.c wouldn't even need patching. > The string 'tilde' need not even be in the patch; what you are really > after is a function that says that if '..' is found within a string > being probed for existence, then add an additional check to see if the > prefix of that string exists as a directory. > > But I don't mind experimenting with the idea - it remains to be seen > whether people will complain that bash is noticeably slower because it > takes time to double-check instead of rely on cygwin's non-POSIX > shortcut. And the slowdown would only be on paths containing a '..'; I > would NOT be checking for symlinks (even though symlinks containing .. > are also being interpreted in a non-POSIX manner, it is much more > expensive to second-guess if you have to check every name for being a > symlink than it is to just check for literal ..). Do I interpret correctly that you talk about bash filename completion here? Referring to http://cygwin.com/ml/cygwin/2013-01/msg00201.html, I'd like to point out that while this ".." thing is a cygwin bug, or known downside as Corinna says, the same issue occurs on Linux precisely with filename completion which isn't consistent there either. So it would be "over-fixing" to handle that specifically in bash. On the other hand, considering again this "downside": If the core cygwin filesystem function would follow this approach, simply checking for an occurrence of ".." first before resolving the filename, wouldn't that be an acceptable fix without inappropriate penalty? ------ Thomas -- 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