www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/02/07/11:12:31

X-Recipient: archive-cygwin AT delorie DOT com
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
Message-ID: <5113D1ED.20305@towo.net>
Date: Thu, 07 Feb 2013 17:10:21 +0100
From: Thomas Wolff <towo AT towo DOT net>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: stat() and tilde prefix (was bad bash tab completion)
References: <5024B4D4 DOT 6080409 AT shaddybaddah DOT name> <50F395D5 DOT 4050201 AT shaddybaddah DOT name> <20130114061747 DOT GB16739 AT ednor DOT casa DOT cgf DOT cx> <20130114100002 DOT GA22039 AT calimero DOT vinschen DOT de> <50F417F9 DOT 8040108 AT shaddybaddah DOT name> <20130114161307 DOT GB8617 AT calimero DOT vinschen DOT de> <50F54C93 DOT 9090702 AT shaddybaddah DOT name> <511350F3 DOT 8040702 AT shaddybaddah DOT name> <5113C886 DOT 9070904 AT redhat DOT com>
In-Reply-To: <5113C886.9070904@redhat.com>
X-TagToolbar-Keys: D20130207171021486
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019